函数逻辑报告

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:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alculate authorization info fields to send to TPM

函数原型:int TSS_authhmac(unsigned char *digest, const unsigned char *key, unsigned int keylen, unsigned char *h1, unsigned char *h2, unsigned int h3, ...)

返回类型:int

参数:

类型参数名称
unsigned char *digest
const unsigned char *key
unsigned intkeylen
unsigned char *h1
unsigned char *h2
unsigned inth3
134  如果非chip则返回:负ENODEV
137  sdesc等于init_sdesc(hashalg)
138  如果是错误
139  打印信息("trusted_key: can't alloc %s\n", hash_alg)
140  返回:错误
143  c等于非非h3
144  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
145  如果ret小于0则转到:out
147  va_start(argp, h3)
148  循环
149  dlen等于va_arg(argp, unsignedint)
150  如果dlen恒等于0则退出
152  data等于va_arg(argp, unsignedchar * )
153  如果非data
154  ret等于负EINVAL
155  退出
157  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
158  如果ret小于0则退出
161  va_end(argp)
162  如果非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
164  如果非retret等于TSS_rawhmac(digest, key, keylen, SHA1_DIGEST_SIZE, paramdigest, TPM_NONCE_SIZE, h1, TPM_NONCE_SIZE, h2, 1, & c, 0, 0)
168  out :
169  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
170  返回:ret
调用者
名称描述
tpm_sealHave the TPM seal(encrypt) the trusted key, possibly based on* Platform Configuration Registers (PCRs). AUTH1 for sealing key.
tpm_unsealse the AUTH2_COMMAND form of unseal, to authorize both key and blob