Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Verify that the current user has added a master key with the given identifier* (returns -ENOKEY if not)

Proto:int fscrypt_verify_key_added(struct super_block *sb, const u8 identifier[16])

Type:int

Parameter:

TypeParameterName
struct super_block *sb
const u8identifier
591  of FSCRYPT_KEY_SPEC_TYPE_* = v2 policy keys are specified by a 16-byte key "identifier" which the kernel* calculates as a cryptographic hash of the key itself,* matching fscrypt_policy_v2::master_key_identifier.
592  memcpy(identifier, identifier, FSCRYPT_KEY_IDENTIFIER_SIZE)
594  key = Find the specified master key in ->s_master_keys.* Returns ERR_PTR(-ENOKEY) if not found.
595  If IS_ERR(key) Then
596  err = PTR_ERR(key)
597  Go to out
599  mk = data[0]
600  mk_user = Find the current user's "key" in the master key's ->mk_users.* Returns ERR_PTR(-ENOKEY) if not found.
601  If IS_ERR(mk_user) Then
602  err = PTR_ERR(mk_user)
603  Else
604  key_put(mk_user)
605  err = 0
607  key_put(key)
608  out :
609  If err == -ENOKEY && Check operation authority Then err = 0
611  Return err
Caller
NameDescribe
set_encryption_policy