函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_crypto.c Create Date:2022-07-27 22:01:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Calculate the hash of template data

函数原型:static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, struct ima_template_desc *td, int num_fields, struct ima_digest_data *hash, struct crypto_shash *tfm)

返回类型:int

参数:

类型参数名称
struct ima_field_data *field_data
struct ima_template_desc *td
intnum_fields
struct ima_digest_data *hash
struct crypto_shash *tfm
472  SHASH_DESC_ON_STACK(shash, tfm)
475  tfm等于tfm
477  length等于获得消息文摘大小
479  rc等于rypto_shash_init() - (re)initialize message digest*@desc: operational state handle that is already filled* The call (re-)initializes the message digest referenced by the* operational state handle. Any potentially existing state created by
480  如果rc不等于0则返回:rc
483 i小于num_fields循环
484  u8 buffer[256] = {0}
485  data_to_hash等于data
486  datalen等于len
487  datalen_to_hash等于如果非ima_canonical_fmtdatalen否则cpu_to_le32(datalen)
490  如果字符串比较不等于0则
494  如果rc退出
496  否则如果字符串比较恒等于0则
498  data_to_hash等于buffer
501  rc等于rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
502  如果rc退出
506  如果非rcrc等于rypto_shash_final() - calculate message digest*@desc: operational state handle that is already filled with data*@out: output buffer filled with the message digest* Finalize the message digest operation and create the message digest
509  返回:rc
调用者
名称描述
ima_calc_field_array_hash