Retrieving Context/Object attributes
bgercken at gmail.com
Hi, I am currently working on a version of tpm_sealdata for TPM2 as a drop in replacement for an existing work flow.
The original code has sections where they are able to access attributes of the sealing context directly as shown below.
Does the current SAPI provide a way to retrieve the encKey and sealKey equivalents?
I have been unable to find the equivalent of Tspi_GetAttribData() in the current API.
Thanks,
-bill
```
/* Encrypt and seal the symmetric key */ // Calls: Tspi_Data_Seal()
if (dataSeal
(hEncdata, hKey, EVP_CIPHER_key_length(EVP_aes_256_cbc()),
randKey, hPcrs) != TSS_SUCCESS)
goto out_close;
if (getAttribData(hEncdata, TSS_TSPATTRIB_ENCDATA_BLOB,
TSS_TSPATTRIB_ENCDATABLOB_BLOB, &encLen,
&encKey) != TSS_SUCCESS)
goto out_close; // Calls Tspi_GetAttribData()
if (getAttribData
(hKey, TSS_TSPATTRIB_KEY_BLOB, TSS_TSPATTRIB_KEYBLOB_BLOB,
&sealKeyLen, &sealKey) != TSS_SUCCESS)
goto out_close;
```Imran Desai
Take a look at Tss2_Sys_Readpublic—https://github.com/tpm2-software/tpm2-tss/blob/master/src/tss2-sys/api/Tss2_Sys_ReadPublic.c#L75-#L83