tpm2-software / tpm2-tss

OSS implementation of the TCG TPM2 Software Stack (TSS2)
https://tpm2-software.github.io
BSD 2-Clause "Simplified" License
736 stars 361 forks source link

[Specification question] Can an ESYS_TR really be NULL? #2357

Open Superhepper opened 2 years ago

Superhepper commented 2 years ago

tpm2-tss version: 3.1.0

I was trying to do a little bit of debugging of our rust wrapper that when running Valgrind complained a lot about Conditional jump or move depends on uninitialised value inside marshalling functions such as, but not limited to, Tss2_MU_TPM2B_NONCE_Marshal when a call to Esys_StartAuthSession was made. So I went to the specification to try to see if there was something that we had missed.

I then found the following which confused me: TSS Enhanced System API (ESAPI) Specification 1.00 Revision 14, page 50

tpmKey: Can be NULL if no salting is required (this represents the case of TPM_RH_NULL from the TPM’s library specification). • bind: Can be NULL (this represents the case of TPM_RH_NULL from the TPM’s library specification).

This is quite confusing because tpmKey and bind are ESYS_TR and I thought they were supposed to be set to ESYS_TR_NONE when they are not set and not to NULL which I interpret should mean 0?

williamcroberts commented 2 years ago

Yeah thats a typo in the spec it should state it can be ESYS_TR_NONE.

williamcroberts commented 2 years ago

@AndreasFuchsSIT I just created a task in the TSSWG to issue an errata for this and assigned it to you :-p

Superhepper commented 2 years ago

Don't forget this one while writing the errata.

https://github.com/tpm2-software/tpm2-tss/issues/1930