函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:scrypt_policy_from_context - convert an fscrypt_context to an fscrypt_policy* Given an fscrypt_context, build the corresponding fscrypt_policy.* Return: 0 on success, or -EINVAL if the fscrypt_context has an unrecognized* version number or size.

函数原型:int fscrypt_policy_from_context(union fscrypt_policy *policy_u, const union fscrypt_context *ctx_u, int ctx_size)

返回类型:int

参数:

类型参数名称
union fscrypt_policy *policy_u
const union fscrypt_context *ctx_u
intctx_size
203  memset(policy_u, 0, policy_u的长度)
205  如果ctx_size小于等于0或ctx_size不等于Return the size expected for the given fscrypt_context based on its version* number, or 0 if the context version is unrecognized.则返回:负EINVAL
209  :version恒等于FSCRYPT_CONTEXT_V1
210  ctx等于v1
211  policy等于v1
213  version等于Legacy policy version; ad-hoc KDF and no key verification.* For new encrypted directories, use fscrypt_policy_v2 instead.* Careful: the .version field for this is actually 0, not 1.
214  contents_encryption_mode等于contents_encryption_mode
216  filenames_encryption_mode等于filenames_encryption_mode
218  flags等于flags
219  memcpy(master_key_descriptor, master_key_descriptor, master_key_descriptor的长度)
222  返回:0
224  :version恒等于FSCRYPT_CONTEXT_V2
225  ctx等于v2
226  policy等于v2
228  version等于New policy version with HKDF and key verification (recommended).
229  contents_encryption_mode等于contents_encryption_mode
231  filenames_encryption_mode等于filenames_encryption_mode
233  flags等于flags
234  memcpy(__reserved, __reserved, __reserved的长度)
236  memcpy(master_key_identifier, master_key_identifier, master_key_identifier的长度)
239  返回:0
243  返回:负EINVAL
调用者
名称描述
fscrypt_get_policyRetrieve an inode's encryption policy
fscrypt_get_encryption_info