Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:verify HMAC before decrypting encrypted key

Proto:static int datablob_hmac_verify(struct encrypted_key_payload *epayload, const u8 *format, const u8 *master_key, size_t master_keylen)

Type:int

Parameter:

TypeParameterName
struct encrypted_key_payload *epayload
const u8 *format
const u8 *master_key
size_tmaster_keylen
532  ret = Derive authentication/encryption key from trusted key
533  If ret < 0 Then Go to out
536  len = length of datablob
537  If Not format Then
538  p = datablob: master key name
539  len -= strlen - Find the length of a string*@s: The string to be sized + 1
540  Else p = datablob: format
543  ret = calc_hmac(digest, derived_key, sizeofderived_key, p, len)
544  If ret < 0 Then Go to out
546  ret = rypto_memneq - Compare two areas of memory without leaking* timing information.*@a: One area of memory*@b: Another area of memory*@size: The size of the area.* Returns 0 when data is equal, 1 otherwise.
548  If ret Then
549  ret = -EINVAL
550  dump_hmac("datablob", datablob: format + length of datablob , HASH_SIZE)
553  dump_hmac("calc", digest, HASH_SIZE)
555  out :
556  memzero_explicit - Fill a region of memory (e
557  Return ret
Caller
NameDescribe
encrypted_key_decrypt