函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\keysetup_v1.c Create Date:2022-07-29 10:57:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Prepare to encrypt directly using the master key in the given mode

函数原型:static struct fscrypt_direct_key *fscrypt_get_direct_key(const struct fscrypt_info *ci, const u8 *raw_key)

返回类型:struct fscrypt_direct_key

参数:

类型参数名称
const struct fscrypt_info *ci
const u8 *raw_key
224  dk等于Find/insert the given key into the fscrypt_direct_keys table. If found, it* is returned with elevated refcount, and 'to_insert' is freed if non-NULL. If* not found, 'to_insert' is inserted and returned if it's non-NULL; otherwise* NULL is returned.
225  如果dk则返回:dk
229  dk等于分配内存并置零
230  如果非dk则返回:错误号
232  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
233  dk_mode等于Encryption mode used for this inode. It corresponds to either the* contents or filenames encryption mode, depending on the inode type.
234  dk_ctfm等于Create a symmetric cipher object for the given encryption mode and key
236  如果是错误
237  err等于错误
238  dk_ctfm = NULL
239  转到:err_free_dk
241  memcpy(dk_descriptor, master_key_descriptor, FSCRYPT_KEY_DESCRIPTOR_SIZE)
243  memcpy(dk_raw, raw_key, keysize)
245  返回:Find/insert the given key into the fscrypt_direct_keys table. If found, it* is returned with elevated refcount, and 'to_insert' is freed if non-NULL. If* not found, 'to_insert' is inserted and returned if it's non-NULL; otherwise* NULL is returned.
247  err_free_dk :
248  free_direct_key(dk)
249  返回:错误号
调用者
名称描述
setup_v1_file_key_directv1 policy, DIRECT_KEY: use the master key directly