Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\encrypted-keys\encrypted.c Create Date:2022-07-28 18:33:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rypted_init - initialize an encrypted key* For a new key, use a random number for both the iv and data* itself. For an old key, decrypt the hex encoded data.

Proto:static int encrypted_init(struct encrypted_key_payload *epayload, const char *key_desc, const char *format, const char *master_desc, const char *datalen, const char *hex_encoded_iv)

Type:int

Parameter:

TypeParameterName
struct encrypted_key_payload *epayload
const char *key_desc
const char *format
const char *master_desc
const char *datalen
const char *hex_encoded_iv
763  ret = 0
765  If format && Not strcmp(format, key_format_ecryptfs) Then
766  ret = valid_ecryptfs_desc - verify the description of a new/loaded encrypted key* The description of a encrypted key with format 'ecryptfs' must contain* exactly 16 hexadecimal characters.
767  If ret < 0 Then Return ret
770  ecryptfs_fill_auth_tok((structecryptfs_auth_tok * ) payload data + datablob + hmac , key_desc)
774  __ekey_init(epayload, format, master_desc, datalen)
775  If Not hex_encoded_iv Then
776  get_random_bytes( datablob: iv , ivsize)
778  get_random_bytes( decrypted data , decrypted data length )
780  Else ret = encrypted_key_decrypt(epayload, format, hex_encoded_iv)
782  Return ret
Caller
NameDescribe
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.