mirror of
https://github.com/stefanberger/libtpms
synced 2026-01-05 17:46:44 +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
d3ce650f93
commit
037eb0e2bb
@ -1708,7 +1708,7 @@ CryptRsaDecrypt(
|
||||
outlen = sizeof(buffer);
|
||||
if (EVP_PKEY_decrypt(ctx, buffer, &outlen,
|
||||
cIn->buffer, cIn->size) <= 0)
|
||||
ERROR_EXIT(TPM_RC_FAILURE);
|
||||
ERROR_EXIT(TPM_RC_VALUE);
|
||||
|
||||
if (outlen > dOut->size)
|
||||
ERROR_EXIT(TPM_RC_FAILURE);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user