mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-10 01:50:04 +00:00
tpm2: Return TPM_RC_VALUE upon decryption failure
When decryption fails then return TPM_RC_VALUE rather than TPM_RC_FAILURE. The old error code could indicate to an application or driver that something is wrong with the TPM (has possibly gone into failure mode) even though only the decryption failed, possibly due to a wrong key. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
e4c35830ab
commit
40c909ec77
@ -1377,7 +1377,7 @@ CryptRsaDecrypt(
|
||||
outlen = sizeof(buffer);
|
||||
if (EVP_PKEY_decrypt(ctx, buffer, &outlen,
|
||||
cIn->buffer, cIn->size) <= 0)
|
||||
ERROR_RETURN(TPM_RC_FAILURE);
|
||||
ERROR_RETURN(TPM_RC_VALUE);
|
||||
|
||||
if (outlen > dOut->size)
|
||||
ERROR_RETURN(TPM_RC_FAILURE);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user