函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\encrypted-keys\encrypted.c Create Date:2022-07-27 20:07:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Allocate memory for decrypted key and datablob.

函数原型:static struct encrypted_key_payload *encrypted_key_alloc(struct key *key, const char *format, const char *master_desc, const char *datalen)

返回类型:struct encrypted_key_payload

参数:

类型参数名称
struct key *key
const char *format
const char *master_desc
const char *datalen
612  struct encrypted_key_payload * epayload = NULL
621  ret等于kstrtol - convert a string to a long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign or a minus sign.
622  如果ret小于0或dlen小于MIN_DATA_SIZEdlen大于MAX_DATA_SIZE则返回:错误号
625  format_len等于如果非formatstrlen - Find the length of a string*@s: The string to be sized否则strlen - Find the length of a string*@s: The string to be sized
626  decrypted_datalen等于dlen
627  payload_datalen等于decrypted_datalen
628  如果format
629  如果非字符串比较
630  如果dlen不等于ECRYPTFS_MAX_KEY_BYTES
631  打印错误信息("encrypted_key: keylen for the ecryptfs format must be equal to %d bytes\n", ECRYPTFS_MAX_KEY_BYTES)
633  返回:错误号
637  否则如果非字符串比较
638  如果decrypted_datalen不等于KEY_ENC32_PAYLOAD_LEN
639  打印错误信息("encrypted_key: enc32 key payload incorrect length: %d\n", decrypted_datalen)
641  返回:错误号
646  encrypted_datalen等于undup - round up to the next specified multiple*@x: the value to up*@y: multiple to round up to* Rounds @x up to next multiple of @y. If @y will always be a power* of 2, consider using the faster round_up().(decrypted_datalen, blksize)
648  datablob_len等于format_len加1加strlen - Find the length of a string*@s: The string to be sized加1加strlen - Find the length of a string*@s: The string to be sized加1加ivsize加1加encrypted_datalen
651  ret等于key_payload_reserve - Adjust data quota reservation for the key's payload*@key: The key to make the reservation for
653  如果ret小于0则返回:错误号
656  epayload等于分配内存并置零
658  如果非epayload则返回:错误号
661  payload data length 等于payload_datalen
662  decrypted data length 等于decrypted_datalen
663  length of datablob 等于datablob_len
664  返回:epayload
调用者
名称描述
encrypted_instantiaterypted_instantiate - instantiate an encrypted key* Decrypt an existing encrypted datablob or create a new encrypted key* based on a kernel random number.* On success, return 0. Otherwise return errno.
encrypted_updaterypted_update - update the master key description* Change the master key description for an existing encrypted key.* The next read will return an encrypted datablob using the new* master key description.* On success, return 0. Otherwise return errno.