Function report |
Source Code:security\keys\trusted-keys\trusted_tpm2.c |
Create Date:2022-07-28 18:32:03 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:pm2_seal_trusted() - seal the payload of a trusted key*@chip: TPM chip to use*@payload: the key data in clear and encrypted form*@options: authentication values and other options* Return: < 0 on error and 0 on success.
Proto:int tpm2_seal_trusted(struct tpm_chip *chip, struct trusted_key_payload *payload, struct trusted_key_options *options)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct tpm_chip * | chip | |
struct trusted_key_payload * | payload | |
struct trusted_key_options * | options |
79 | If i == ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(tpm2_hash_map) Then Return -EINVAL |
82 | rc = tpm_buf_init( & buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE) |
86 | tpm_buf_append_u32( & buf, keyhandle) |
94 | tpm_buf_append_u16( & buf, 4 + Max TPM v1.2 PCR size + key_len + 1) |
96 | tpm_buf_append_u16( & buf, Max TPM v1.2 PCR size ) |
97 | tpm_buf_append( & buf, blobauth, Max TPM v1.2 PCR size ) |
98 | tpm_buf_append_u16( & buf, key_len + 1) |
99 | tpm_buf_append( & buf, key, key_len) |
100 | tpm_buf_append_u8( & buf, migratable) |
103 | tpm_buf_append_u16( & buf, 14 + policydigest_len) |
104 | tpm_buf_append_u16( & buf, TPM_ALG_KEYEDHASH) |
105 | tpm_buf_append_u16( & buf, hash) |
108 | If policydigest_len Then |
109 | tpm_buf_append_u32( & buf, 0) |
110 | tpm_buf_append_u16( & buf, policydigest_len) |
111 | tpm_buf_append( & buf, policydigest, policydigest_len) |
113 | Else |
114 | tpm_buf_append_u32( & buf, TPM2_OA_USER_WITH_AUTH) |
115 | tpm_buf_append_u16( & buf, 0) |
119 | tpm_buf_append_u16( & buf, TPM_ALG_NULL) |
120 | tpm_buf_append_u16( & buf, 0) |
123 | tpm_buf_append_u16( & buf, 0) |
126 | tpm_buf_append_u32( & buf, 0) |
128 | If flags & TPM_BUF_OVERFLOW Then |
137 | blob_len = be32_to_cpup((__be32 * ) & data[TPM_HEADER_SIZE]) |
138 | If blob_len > MAX_BLOB_SIZE Then |
142 | If tpm_buf_length( & buf) < TPM_HEADER_SIZE + 4 + blob_len Then |
147 | memcpy(blob, & data[TPM_HEADER_SIZE + 4], blob_len) |
150 | out : |
151 | tpm_buf_destroy( & buf) |
153 | If rc > 0 Then |
160 | Return rc |
Name | Describe |
---|---|
trusted_instantiate | rusted_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. |
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 |