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:34:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rypted_read - format and copy the encrypted data to userspace* The resulting datablob format is:* <master-key name> <decrypted data length> <encrypted iv> <encrypted data>* On success, return to userspace the encrypted key datablob size.

Proto:static long encrypted_read(const struct key *key, char __user *buffer, size_t buflen)

Type:long

Parameter:

TypeParameterName
const struct key *key
char __user *buffer
size_tbuflen
924  epayload = dereference_key_locked(key)
927  asciiblob_len = length of datablob + ivsize + 1 + 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 data length , blksize) + HASH_SIZE * 2
931  If Not buffer || buflen < asciiblob_len Then Return asciiblob_len
934  mkey = request_master_key(epayload, & master_key, & master_keylen)
935  If IS_ERR(mkey) Then Return PTR_ERR(mkey)
938  ret = Derive authentication/encryption key from trusted key
939  If ret < 0 Then Go to out
942  ret = Before returning data to userspace, encrypt decrypted data.
943  If ret < 0 Then Go to out
946  ret = datablob_hmac_append(epayload, master_key, master_keylen)
947  If ret < 0 Then Go to out
950  ascii_buf = datablob_format - format as an ascii string, before copying to userspace
951  If Not ascii_buf Then
952  ret = -ENOMEM
953  Go to out
956  lease a read lock
957  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
958  memzero_explicit - Fill a region of memory (e
960  If copy_to_user(buffer, ascii_buf, asciiblob_len) != 0 Then ret = -EFAULT
962  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
964  Return asciiblob_len
965  out :
966  lease a read lock
967  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
968  memzero_explicit - Fill a region of memory (e
969  Return ret