函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int encrypted_instantiate(struct key *key, struct key_preparsed_payload *prep)

返回类型:int

参数:

类型参数名称
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  如果datalen小于等于0或datalen大于32767或非Raw data 则返回:负EINVAL
808  datablob等于开辟内存
809  如果非datablob则返回:负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  如果ret小于0则转到:out
818  epayload等于Allocate memory for decrypted key and datablob.
820  如果是错误
821  ret等于错误
822  转到: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  如果ret小于0则
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  转到: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  返回:ret