函数逻辑报告

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_new_context_from_policy - create a new fscrypt_context from a policy* Create an fscrypt_context for an inode that is being assigned the given* encryption policy. A new nonce is randomly generated.* Return: the size of the new context in bytes.

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

返回类型:int

参数:

类型参数名称
union fscrypt_context *ctx_u
const union fscrypt_policy *policy_u
149  memset(ctx_u, 0, ctx_u的长度)
152  :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.
153  policy等于v1
154  ctx等于v1
156  FSCRYPT_CONTEXT_V1 等于FSCRYPT_CONTEXT_V1
157  contents_encryption_mode等于contents_encryption_mode
159  filenames_encryption_mode等于filenames_encryption_mode
161  flags等于flags
162  memcpy(master_key_descriptor, master_key_descriptor, master_key_descriptor的长度)
165  get_random_bytes(nonce, nonce的长度)
166  返回:ctx的长度
168  :version恒等于New policy version with HKDF and key verification (recommended).
169  policy等于v2
170  ctx等于v2
172  FSCRYPT_CONTEXT_V2 等于FSCRYPT_CONTEXT_V2
173  contents_encryption_mode等于contents_encryption_mode
175  filenames_encryption_mode等于filenames_encryption_mode
177  flags等于flags
178  memcpy(master_key_identifier, master_key_identifier, master_key_identifier的长度)
181  get_random_bytes(nonce, nonce的长度)
182  返回:ctx的长度
185  BUG()