Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_appraise.c Create Date:2022-07-28 19:59:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ima_get_hash_algo

Proto:enum hash_algo ima_get_hash_algo(struct evm_ima_xattr_data *xattr_value, int xattr_len)

Type:enum hash_algo

Parameter:

TypeParameterName
struct evm_ima_xattr_data *xattr_value
intxattr_len
157  If Not xattr_value || xattr_len < 2 Then Return ima_hash_algo
162  Case type == EVM_IMA_XATTR_DIGSIG
163  sig = xattr_value
164  If signature format version != 2 || xattr_len <= size of sig Then Return ima_hash_algo
166  Return Digest algorithm [enum hash_algo]
167  Break
168  Case type == IMA_XATTR_DIGEST_NG
170  ret = data[0]
171  If ret < HASH_ALGO__LAST Then Return ret
173  Break
174  Case type == IMA_XATTR_DIGEST
176  If xattr_len == 21 Then
177  zero = 0
178  If Not memcmp( & data[16], & zero, 4) Then Return HASH_ALGO_MD5
180  Else Return HASH_ALGO_SHA1
182  Else if xattr_len == 17 Then Return HASH_ALGO_MD5
184  Break
188  Return ima_hash_algo