函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Derive authentication/encryption key from trusted key

函数原型:static int get_derived_key(u8 *derived_key, enum derived_key_type key_type, const u8 *master_key, size_t master_keylen)

返回类型:int

参数:

类型参数名称
u8 *derived_key
enum derived_key_typekey_type
const u8 *master_key
size_tmaster_keylen
369  derived_buf_len等于strlen - Find the length of a string*@s: The string to be sized加1加master_keylen
370  如果derived_buf_len小于HASH_SIZEderived_buf_len等于HASH_SIZE
373  derived_buf等于分配内存并置零
374  如果非derived_buf则返回:负ENOMEM
377  如果key_typestrcpy(derived_buf, "AUTH_KEY")
379  否则strcpy(derived_buf, "ENC_KEY")
382  memcpy(derived_buf + strlen - Find the length of a string*@s: The string to be sized + 1, master_key, master_keylen)
384  ret等于calc_hash(hash_tfm, derived_key, derived_buf, derived_buf_len)
385  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
386  返回:ret
调用者
名称描述
datablob_hmac_append
datablob_hmac_verifyverify HMAC before decrypting encrypted key
encrypted_key_decrypt
encrypted_readrypted_read - format and copy the encrypted data to userspace* The resulting datablob format is:* * On success, return to userspace the encrypted key datablob size.