Handling of TPM_CERTIFY_INFO2 structure special case
Handling of TPM_CERTIFY_INFO2 structure special case

Fixes SF bug #3400858

According to the TPM specification, TPM_CertifyKey returns a
TPM_CERTIFY_INFO2 in case the PCR set is > 16, and a TPM_CERTIFY_INFO
otherwise.

When the TPM returns a TPM_CERTIFY_INFO2 structure, the extra fields,
"migrationAuthoritySize" and "migrationAuthority" are present in certifyInfo.
Trousers doesn't notice this, and interprets migrationAuthoritySize (which is,
in my case, zero) as TPM_CertifyInfo's outDataSize output. Thus it thinks
outData is empty.

The result of this is that Tspi_Key_CertifyKey returns successfully but with a
zero-length string in pValidationData.rgbValidationData.

Signed-off-by: Rajiv Andrade <3cd4580e3c128af73a5b4375e865c34e65fd90b2@linux.vnet.ibm.com>

Distrotech/trousers,Distrotech/trousers,Distrotech/trousers,emilcondrea/trousers,emilcondrea/trousers,emilcondrea/trousers