函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\trusted-keys\trusted_tpm1.c Create Date:2022-07-27 20:04:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:TSS_rawhmac

函数原型:static int TSS_rawhmac(unsigned char *digest, const unsigned char *key, unsigned int keylen, ...)

返回类型:int

参数:

类型参数名称
unsigned char *digest
const unsigned char *key
unsigned intkeylen
84  sdesc等于init_sdesc(hmacalg)
85  如果是错误
86  打印信息("trusted_key: can't alloc %s\n", hmac_alg)
87  返回:错误
90  ret等于rypto_shash_setkey() - set key for message digest*@tfm: cipher handle*@key: buffer holding the key*@keylen: length of the key in bytes* The caller provided key is set for the keyed message digest cipher
91  如果ret小于0则转到:out
93  ret等于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
94  如果ret小于0则转到:out
97  va_start(argp, keylen)
98  循环
99  dlen等于va_arg(argp, unsignedint)
100  如果dlen恒等于0则退出
102  data等于va_arg(argp, unsignedchar * )
103  如果(data == NULL)则
104  ret等于负EINVAL
105  退出
107  ret等于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
108  如果ret小于0则退出
111  va_end(argp)
112  如果非retret等于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
114  out :
115  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
116  返回:ret
调用者
名称描述
TSS_authhmacalculate authorization info fields to send to TPM
TSS_checkhmac1verify the AUTH1_COMMAND (Seal) result from TPM
TSS_checkhmac2verify the AUTH2_COMMAND (unseal) result from TPM
osapCreate an object specific authorisation protocol (OSAP) session