summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-07 09:45:40 +1000
committerPauli <pauli@openssl.org>2021-06-08 19:32:25 +1000
commit3f617061eceb2f33fb40682cc7b14cc4f9a2143f (patch)
treeb78745ae89ae9ac4297300c71e5b257e4a823877 /crypto
parentdacb0d8f79debfe6b47f4b17ed6a51449dd7e484 (diff)
evp: fix Coverity 1485669 improper use of negative value
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15635)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/ctrl_params_translate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
index e289c7df7b..6998dcc6fc 100644
--- a/crypto/evp/ctrl_params_translate.c
+++ b/crypto/evp/ctrl_params_translate.c
@@ -1704,6 +1704,10 @@ static int get_ec_decoded_from_explicit_params(enum state state,
#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
val = EC_KEY_decoded_from_explicit_params(EVP_PKEY_get0_EC_KEY(pkey));
+ if (val < 0) {
+ ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);
+ return 0;
+ }
break;
#endif
default: