Function report |
Source Code:security\keys\trusted-keys\trusted_tpm1.c |
Create Date:2022-07-28 18:31:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:an have zero or more token= options
Proto:static int getoptions(char *c, struct trusted_key_payload *pay, struct trusted_key_options *opt)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
char * | c | |
struct trusted_key_payload * | pay | |
struct trusted_key_options * | opt |
740 | token_mask = 0 |
745 | tpm2 = tpm_is_tpm2(chip) |
749 | hash = If tpm2 Then HASH_ALGO_SHA256 Else HASH_ALGO_SHA1 |
754 | token = match_token(p, key_tokens, args) |
755 | If st_and_set_bit - Set a bit and return its old value*@nr: Bit to set*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier). Then Return -EINVAL |
759 | Case token == Opt_pcrinfo |
761 | If pcrinfo_len > MAX_PCRINFO_SIZE Then Return -EINVAL |
767 | Break |
768 | Case token == Opt_keyhandle |
772 | keytype = SEAL_keytype |
774 | Break |
775 | Case token == Opt_keyauth |
776 | If strlen - Find the length of a string*@s: The string to be sized != 2 * SHA1_DIGEST_SIZE Then Return -EINVAL |
782 | Break |
783 | Case token == Opt_blobauth |
784 | If strlen - Find the length of a string*@s: The string to be sized != 2 * SHA1_DIGEST_SIZE Then Return -EINVAL |
790 | Break |
791 | Case token == Opt_migratable |
797 | Case token == Opt_pcrlock |
802 | Break |
804 | If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Return -EINVAL |
806 | When i < HASH_ALGO__LAST cycle |
812 | If i == HASH_ALGO__LAST Then Return -EINVAL |
814 | If Not tpm2 && i != HASH_ALGO_SHA1 Then |
818 | Break |
819 | Case token == Opt_policydigest |
820 | digest_len = hash_digest_size[hash] |
821 | If Not tpm2 || strlen - Find the length of a string*@s: The string to be sized != 2 * digest_len Then Return -EINVAL |
827 | policydigest_len = digest_len |
828 | Break |
829 | Case token == Opt_policyhandle |
835 | policyhandle = handle |
836 | Break |
837 | Default |
838 | Return -EINVAL |
841 | Return 0 |
Name | Describe |
---|---|
datablob_parse | datablob_parse - parse the keyctl data and fill in the* payload and options structures* On success returns 0, otherwise -EINVAL. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |