Open williamcroberts opened 1 year ago
And could you please write a draft test script indicating what should be the end result? Some shell script that would setup the TPM, create whatever needs to be created before the openssl commands are executed?
Really all you have to do it call is Esys_StartAuthSession() With an established ESYS_TR object and then use Esys_TRSess_SetAttributes() To set the flags for encryption.
You can use the parent key as tpmKey parameter in the call to Esys_StartAuthSession. Then you just pass that session to all the following Esys routines, either as session1 or session2 in the Function call. For instance, in Esys_Sign() session1 is going to be the ESYS_TR_PASSWORD Session, so you would pass it as session2,. For other things that have session1 as ESYS_TR_NONE You can just pass it as session 1.
The crux is that you need both the handle and a name. The PEM format only has the raw TPM handle Or the primary key is created with createprimary. As a side note, this is what makes ESYS_TRs useful, It’s a coupling of name and handle, this is why you can just pass is to ESys_StartAuthSession and not Worry. The name of an object is unspoofable and unforgeable. Continuing on, there are two ways you can you solve this:
You could use both of these, let OSSL config over ride, so I'd start with 1.
It's not as bad as it looks tpm2-pkcs11 does this.
Concisely the steps are:
Phase 1:
ESYS_TR_NONE
session "slot".
Enable Verified Session Support, not sure where you can shove a trusted key in to enable session protections with the TPM.