Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:alculate authorization info fields to send to TPM

Proto:int TSS_authhmac(unsigned char *digest, const unsigned char *key, unsigned int keylen, unsigned char *h1, unsigned char *h2, unsigned int h3, ...)

Type:int

Parameter:

TypeParameterName
unsigned char *digest
const unsigned char *key
unsigned intkeylen
unsigned char *h1
unsigned char *h2
unsigned inth3
134  If Not chip Then Return -ENODEV
137  sdesc = init_sdesc(hashalg)
138  If IS_ERR(sdesc) Then
139  pr_info("trusted_key: can't alloc %s\n", hash_alg)
140  Return PTR_ERR(sdesc)
143  c = Not Not 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  If ret < 0 Then Go to out
147  va_start(argp, h3)
148  cycle
149  dlen = va_arg(argp, unsignedint)
150  If dlen == 0 Then Break
152  data = va_arg(argp, unsignedchar * )
153  If Not data Then
154  ret = -EINVAL
155  Break
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  If ret < 0 Then Break
161  va_end(argp)
162  If Not ret Then ret = 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  If Not ret Then ret = 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  Return ret
Caller
NameDescribe
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