Skip to contentSkip to conversation

Retrieving Context/Object attributes

tpm2 bgercken at gmail.com 2 participants 2 messages Oct 6, 2020 – Oct 12, 2020

lore
Share & tools
lore

bgercken at gmail.com

#0 lore raw

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;

```