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

Name:rypted_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.

Proto:static int encrypted_instantiate(struct key *key, struct key_preparsed_payload *prep)

Type:int

Parameter:

TypeParameterName
struct key *key
struct key_preparsed_payload *prep
796  struct encrypted_key_payload * epayload = NULL
797  char * datablob = NULL
798  const char * format = NULL
799  char * master_desc = NULL
800  char * decrypted_datalen = NULL
801  char * hex_encoded_iv = NULL
802  datalen = Raw datalen
805  If datalen <= 0 || datalen > 32767 || Not Raw data Then Return -EINVAL
808  datablob = Allocation memory
809  If Not datablob Then Return -ENOMEM
811  datablob[datalen] = 0
812  memcpy(datablob, Raw data , datalen)
813  ret = datablob_parse - parse the keyctl data* datablob format:* new [] * load [] * * update * Tokenizes a copy of the
815  If ret < 0 Then Go to out
818  epayload = Allocate memory for decrypted key and datablob.
820  If IS_ERR(epayload) Then
821  ret = PTR_ERR(epayload)
822  Go to out
824  ret = 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.
826  If ret < 0 Then
827  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
828  Go to out
831  rcu_assign_keypointer(key, epayload)
832  out :
833  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
834  Return ret