Fix checking return code of EVP_PKEY_get_int_param at check_curve

According to docs, EVP_PKEY_get_int_param should return 1 on Success, and
0 on Failure. So, fix checking of this return value at check_curve

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20770)
This commit is contained in:
Petr Mikhalicin 2023-04-19 14:43:02 +03:00 committed by Tomas Mraz
parent a901b31e99
commit 4e5f3d6913

View File

@ -3642,7 +3642,7 @@ static int check_curve(X509 *cert)
EVP_PKEY_get_int_param(pkey,
OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS,
&val);
return ret < 0 ? ret : !val;
return ret == 1 ? !val : -1;
}
/*-