Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:datablob_parse - parse the keyctl data and fill in the* payload and options structures* On success returns 0, otherwise -EINVAL.

Proto:static int datablob_parse(char *datablob, struct trusted_key_payload *p, struct trusted_key_options *o)

Type:int

Parameter:

TypeParameterName
char *datablob
struct trusted_key_payload *p
struct trusted_key_options *o
855  ret = -EINVAL
860  c = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
861  If Not c Then Return -EINVAL
863  key_cmd = match_token(c, key_tokens, args)
865  Case key_cmd == Opt_new
867  c = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
868  If Not c Then Return -EINVAL
870  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.
871  If ret < 0 || keylen < MIN_KEY_SIZE || keylen > MAX_KEY_SIZE Then Return -EINVAL
873  key_len = keylen
874  ret = an have zero or more token= options
875  If ret < 0 Then Return ret
877  ret = Opt_new
878  Break
879  Case key_cmd == Opt_load
881  c = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
882  If Not c Then Return -EINVAL
884  blob_len = strlen - Find the length of a string*@s: The string to be sized / 2
885  If blob_len > MAX_BLOB_SIZE Then Return -EINVAL
887  ret = hex2bin - convert an ascii hexadecimal string to its binary representation*@dst: binary result*@src: ascii hexadecimal string*@count: result length* Return 0 on success, -EINVAL in case of bad input.
888  If ret < 0 Then Return -EINVAL
890  ret = an have zero or more token= options
891  If ret < 0 Then Return ret
893  ret = Opt_load
894  Break
895  Case key_cmd == Opt_update
897  ret = an have zero or more token= options
898  If ret < 0 Then Return ret
900  ret = Opt_update
901  Break
902  Case key_cmd == Opt_err
903  Return -EINVAL
904  Break
906  Return ret
Caller
NameDescribe
trusted_instantiaterusted_instantiate - create a new trusted key* Unseal an existing trusted blob or, for a new key, get a* random key, then seal and create a trusted key-type key,* adding it to the specified keyring.* On success, return 0. Otherwise return errno.
trusted_updaterusted_update - reseal an existing key with new PCR values