diff --git a/src/tss2-esys/api/Esys_StartAuthSession.c b/src/tss2-esys/api/Esys_StartAuthSession.c index 076760d0b..aa8c03f8f 100644 --- a/src/tss2-esys/api/Esys_StartAuthSession.c +++ b/src/tss2-esys/api/Esys_StartAuthSession.c @@ -469,6 +469,16 @@ Esys_StartAuthSession_Finish( LOG_ERROR("Out of memory."); return TSS2_ESYS_RC_MEMORY; } + + /* + * TPM2.0 Architecture 19.6.5 Note 2 + * + * Remove tailing zeroes from the auth value + */ + while ((bindNode->auth.size > 0) && + (bindNode->auth.buffer[bindNode->auth.size - 1] == 0x00)) + bindNode->auth.size--; + if (bind != ESYS_TR_NONE && bindNode != NULL && bindNode->auth.size > 0) memcpy(&secret[0], &bindNode->auth.buffer[0], bindNode->auth.size);