mirror of https://github.com/openssl/openssl.git
Fix the check of EVP_PKEY_decrypt_init
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19819)
(cherry picked from commit b794476df7)
This commit is contained in:
parent
6a858e9f59
commit
bdb66dd4c5
|
|
@ -648,7 +648,7 @@ X509
|
|||
cikeysize = EVP_CIPHER_get_key_length(cipher);
|
||||
/* first the symmetric key needs to be decrypted */
|
||||
pkctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, propq);
|
||||
if (pkctx != NULL && EVP_PKEY_decrypt_init(pkctx)) {
|
||||
if (pkctx != NULL && EVP_PKEY_decrypt_init(pkctx) > 0) {
|
||||
ASN1_BIT_STRING *encKey = ecert->encSymmKey;
|
||||
size_t failure;
|
||||
int retval;
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,7 @@ static int test_EVP_SM2(void)
|
|||
sizeof(kMsg))))
|
||||
goto done;
|
||||
|
||||
if (!TEST_true(EVP_PKEY_decrypt_init(cctx)))
|
||||
if (!TEST_int_gt(EVP_PKEY_decrypt_init(cctx), 0))
|
||||
goto done;
|
||||
|
||||
if (!TEST_true(EVP_PKEY_CTX_set_params(cctx, sparams)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue