mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
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)
This commit is contained in:
parent
639e576023
commit
7e5e91176b
@ -2343,10 +2343,10 @@ int EVP_PKEY_get_params(const EVP_PKEY *pkey, OSSL_PARAM params[])
|
|||||||
{
|
{
|
||||||
if (pkey != NULL) {
|
if (pkey != NULL) {
|
||||||
if (evp_pkey_is_provided(pkey))
|
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
|
#ifndef FIPS_MODULE
|
||||||
else if (evp_pkey_is_legacy(pkey))
|
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
|
#endif
|
||||||
}
|
}
|
||||||
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);
|
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);
|
||||||
|
@ -79,7 +79,7 @@ These functions only work for B<EVP_PKEY>s that contain a provider side key.
|
|||||||
|
|
||||||
=head1 RETURN VALUES
|
=head1 RETURN VALUES
|
||||||
|
|
||||||
EVP_PKEY_gettable_params() returns NULL on error or if it is not supported,
|
EVP_PKEY_gettable_params() returns NULL on error or if it is not supported.
|
||||||
|
|
||||||
All other methods return 1 if a value associated with the key's I<key_name> was
|
All other methods return 1 if a value associated with the key's I<key_name> was
|
||||||
successfully returned, or 0 if there was an error.
|
successfully returned, or 0 if there was an error.
|
||||||
|
Loading…
Reference in New Issue
Block a user