mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-08 10:06:32 +00:00
tpm2: Do not call EVP_PKEY_CTX_set0_rsa_oaep_label() for label of size 0 (OSSL 3)
Openssl 3.0 did return an error if EVP_PKEY_CTX_set0_rsa_oaep_label was called with label size 0. The function should only be called if the size of the label is greater 0. With this fix TPM2_RSA_Encrypt/Decrypt did work with OpenSSL 1.1 and 3.0 for encryption without label. Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
This commit is contained in:
parent
a8622792c0
commit
f7f89e33da
@ -1356,10 +1356,9 @@ CryptRsaEncrypt(
|
||||
if (tmp == NULL)
|
||||
ERROR_RETURN(TPM_RC_FAILURE);
|
||||
memcpy(tmp, label->buffer, label->size);
|
||||
if (EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, tmp, label->size) <= 0)
|
||||
ERROR_RETURN(TPM_RC_FAILURE);
|
||||
}
|
||||
// label->size == 0 is supported
|
||||
if (EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, tmp, label->size) <= 0)
|
||||
ERROR_RETURN(TPM_RC_FAILURE);
|
||||
tmp = NULL;
|
||||
break;
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user