Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ame_encrypt() - encrypt a filename* The output buffer must be at least as large as the input buffer.* Any extra space is filled with NUL padding before encryption.* Return: 0 on success, -errno on failure

Proto:int fname_encrypt(struct inode *inode, const struct qstr *iname, u8 *out, unsigned int olen)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const struct qstr *iname
u8 *out
unsigned intolen
40  struct skcipher_request * req = NULL
42  ci = i_crypt_info
43  tfm = The actual crypto transform used for encryption and decryption
52  If WARN_ON(olen < len) Then Return -ENOBUFS
54  memcpy(out, name, len)
55  memset(out + len, 0, olen - len)
58  fscrypt_generate_iv( & iv, 0, ci)
61  req = skcipher_request_alloc() - allocate request data structure*@tfm: cipher handle to be registered with the request*@gfp: memory allocation flag that is handed to kmalloc by the API call
62  If Not req Then Return -ENOMEM
64  skcipher_request_set_callback() - set asynchronous callback function*@req: request handle*@flags: specify zero or an ORing of the flags* CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and* increase the wait queue beyond the initial maximum
67  sg_init_one - Initialize a single entry sg list*@sg: SG entry*@buf: Virtual address for IO*@buflen: IO length
68  skcipher_request_set_crypt() - set data buffers*@req: request handle*@src: source scatter / gather list*@dst: destination scatter / gather list*@cryptlen: number of bytes to process from @src*@iv: IV for the cipher operation which must comply with the IV
71  res = crypto_wait_req(rypto_skcipher_encrypt() - encrypt plaintext*@req: reference to the skcipher_request handle that holds all information* needed to perform the cipher operation* Encrypt plaintext data using the skcipher_request handle, & wait)
72  skcipher_request_free() - zeroize and free request data structure*@req: request data structure cipher handle to be freed
73  If res < 0 Then
74  fscrypt_err(inode, "Filename encryption failed: %d", res)
75  Return res
78  Return 0
Caller
NameDescribe
fscrypt_setup_filenamescrypt_setup_filename() - prepare to search a possibly encrypted directory*@dir: the directory that will be searched*@iname: the user-provided filename being searched for*@lookup: 1 if we're allowed to proceed without the key because it's* ->lookup() or
__fscrypt_encrypt_symlink