mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-09 06:56:51 +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
4fcbaaab30
commit
1b0b41293a
@ -1457,7 +1457,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