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:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:TSS_rawhmac

Proto:static int TSS_rawhmac(unsigned char *digest, const unsigned char *key, unsigned int keylen, ...)

Type:int

Parameter:

TypeParameterName
unsigned char *digest
const unsigned char *key
unsigned intkeylen
84  sdesc = init_sdesc(hmacalg)
85  If IS_ERR(sdesc) Then
86  pr_info("trusted_key: can't alloc %s\n", hmac_alg)
87  Return PTR_ERR(sdesc)
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  If ret < 0 Then Go to 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  If ret < 0 Then Go to out
97  va_start(argp, keylen)
98  cycle
99  dlen = va_arg(argp, unsignedint)
100  If dlen == 0 Then Break
102  data = va_arg(argp, unsignedchar * )
103  If (data == NULL) Then
104  ret = -EINVAL
105  Break
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  If ret < 0 Then Break
111  va_end(argp)
112  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
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  Return ret
Caller
NameDescribe
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