tpm2: RSADP: Replace local bnP with P of new privateExponent

Replace the local variable bnP with Z->P. Initialize Z->P with the
value that bnP had been initialized with.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2023-08-28 09:24:27 -04:00 committed by Stefan Berger
parent a866dda5ed
commit 7edfb28a2e

View File

@ -319,7 +319,7 @@ RSADP(
)
{
BN_RSA_INITIALIZED(bnM, inOut);
BN_RSA_INITIALIZED(bnP, &key->sensitive.sensitive.rsa);
NEW_PRIVATE_EXPONENT(Z);
if(UnsignedCompareB(inOut->size, inOut->buffer,
key->publicArea.unique.rsa.t.size,
key->publicArea.unique.rsa.t.buffer) >= 0)
@ -334,7 +334,8 @@ RSADP(
!= TPM_RC_SUCCESS)
return TPM_RC_BINDING;
}
VERIFY(RsaPrivateKeyOp(bnM, bnP, &key->privateExponent));
VERIFY(BnFrom2B(Z->P, &key->sensitive.sensitive.rsa.b) != NULL);
VERIFY(RsaPrivateKeyOp(bnM, Z->P, &key->privateExponent));
VERIFY(BnTo2B(bnM, inOut, inOut->size));
return TPM_RC_SUCCESS;
Error: