Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\policy.c Create Date:2022-07-28 20:24:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:set_encryption_policy

Proto:static int set_encryption_policy(struct inode *inode, const union fscrypt_policy *policy)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const union fscrypt_policy *policy
277  If Not scrypt_supported_policy - check whether an encryption policy is supported* Given an encryption policy, check whether all its encryption modes and other* settings are supported by this kernel Then Return -EINVAL
281  Case 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.
293  pr_warn_once("%s (pid %d) is setting deprecated v1 encryption policy; recommend upgrading to v2.\n", comm, pid)
295  Break
296  Case version == New policy version with HKDF and key verification (recommended).
297  err = Verify that the current user has added a master key with the given identifier* (returns -ENOKEY if not)
299  If err Then Return err
301  Break
302  Default
303  WARN_ON(1)
304  Return -EINVAL
307  ctxsize = fscrypt_new_context_from_policy( & ctx, policy)
309  Return set_context(inode, & ctx, ctxsize, NULL)