aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-21 15:27:04 +0800
committerPauli <pauli@openssl.org>2022-05-26 11:49:20 +1000
commitd3c5aff6cbf1ed6c855fb450b2caefbda8b9ce0f (patch)
tree5bf56bdc28ff5c2f8a70d91bc4261b0b81c3eba4 /crypto
parentc77eb85017492c076ec749a25c7e57fc0c39a6bf (diff)
downloadopenssl-d3c5aff6cbf1ed6c855fb450b2caefbda8b9ce0f.zip
openssl-d3c5aff6cbf1ed6c855fb450b2caefbda8b9ce0f.tar.gz
openssl-d3c5aff6cbf1ed6c855fb450b2caefbda8b9ce0f.tar.bz2
Fix the defective check of EVP_PKEY_get_params
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18367) (cherry picked from commit 7e5e91176b770a68bdaf73a5c647f1fc0d7f2900)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/p_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index a4ad904..4688325 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -2343,10 +2343,10 @@ int EVP_PKEY_get_params(const EVP_PKEY *pkey, OSSL_PARAM params[])
{
if (pkey != NULL) {
if (evp_pkey_is_provided(pkey))
- return evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params);
+ return evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params) > 0;
#ifndef FIPS_MODULE
else if (evp_pkey_is_legacy(pkey))
- return evp_pkey_get_params_to_ctrl(pkey, params);
+ return evp_pkey_get_params_to_ctrl(pkey, params) > 0;
#endif
}
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);