microsoft / ms-tpm-20-ref

Reference implementation of the TCG Trusted Platform Module 2.0 specification.
Other
343 stars 133 forks source link

TpmFailureMode: Add missing request size checks #92

Closed DemiMarie closed 11 months ago

DemiMarie commented 1 year ago

This is harmless, but it is inconsistent with the non-failure case.

bradlitterell commented 11 months ago

I don't think the behavior of this is correct per section 12.4 of the specification. When the TPM is in failure mode, the TPM always returns TPM_RC_FAILURE, so the unmarshalling error returns here are actually not correct. The only thing the code needs to do is see if it can safely pull out the command code, and should return TPM_RC_FAILURE if anything goes wrong.