Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ima_eventdigest_init_common

Proto:static int ima_eventdigest_init_common(const u8 *digest, unsigned int digestsize, u8 hash_algo, struct ima_field_data *field_data)

Type:int

Parameter:

TypeParameterName
const u8 *digest
unsigned intdigestsize
u8hash_algo
struct ima_field_data *field_data
239  u8 buffer[194] = {0}
240  fmt = DATA_FMT_DIGEST
241  offset = 0
243  If hash_algo < HASH_ALGO__LAST Then
244  fmt = DATA_FMT_DIGEST_WITH_ALGO
245  offset += snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
247  buffer[offset] = ':'
248  offset += 2
251  If digest Then memcpy(buffer + offset, digest, digestsize)
253  Else offset += digest size for IMA, fits SHA1 or MD5
261  Return ima_write_template_field_data(buffer, offset + digestsize, fmt, field_data)
Caller
NameDescribe
ima_eventdigest_initThis function writes the digest of an event (with size limit).
ima_eventdigest_ng_initThis function writes the digest of an event (without size limit).
ima_eventdigest_modsig_initThis function writes the digest of the file which is expected to match the* digest contained in the file's appended signature.