Function report |
Source Code:security\keys\trusted-keys\trusted_tpm1.c |
Create Date:2022-07-28 18:30:49 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:se the AUTH2_COMMAND form of unseal, to authorize both key and blob
Proto:static int tpm_unseal(struct tpm_buf *tb, uint32_t keyhandle, const unsigned char *keyauth, const unsigned char *blob, int bloblen, const unsigned char *blobauth, unsigned char *data, unsigned int *datalen)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct tpm_buf * | tb | |
| uint32_t | keyhandle | |
| const unsigned char * | keyauth | |
| const unsigned char * | blob | |
| int | bloblen | |
| const unsigned char * | blobauth | |
| unsigned char * | data | |
| unsigned int * | datalen |
| 584 | authhandle1 = 0 |
| 585 | authhandle2 = 0 |
| 586 | cont = 0 |
| 592 | If ret < 0 Then |
| 597 | If ret < 0 Then |
| 602 | ordinal = htonl(TPM_ORD_UNSEAL) |
| 603 | ret = tpm_get_random(chip, nonceodd, TPM_NONCE_SIZE) |
| 604 | If ret != TPM_NONCE_SIZE Then |
| 621 | tpm_buf_append_u32(tb, keyhandle) |
| 622 | tpm_buf_append(tb, blob, bloblen) |
| 623 | tpm_buf_append_u32(tb, authhandle1) |
| 624 | tpm_buf_append(tb, nonceodd, TPM_NONCE_SIZE) |
| 625 | tpm_buf_append_u8(tb, cont) |
| 627 | tpm_buf_append_u32(tb, authhandle2) |
| 628 | tpm_buf_append(tb, nonceodd, TPM_NONCE_SIZE) |
| 629 | tpm_buf_append_u8(tb, cont) |
| 632 | ret = For key specific tpm requests, we will generate and send our* own TPM command packets using the drivers send function. |
| 633 | If ret < 0 Then |
| 638 | datalen = LOAD32(data, TPM_DATA_OFFSET) |
| 645 | If ret < 0 Then |
| 650 | Return 0 |
| Name | Describe |
|---|---|
| key_unseal | Have the TPM unseal(decrypt) the symmetric key |
| 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 |