diff options
author | Matt Caswell <matt@openssl.org> | 2015-11-06 16:31:21 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-20 15:47:02 +0000 |
commit | 5f3d93e4a336c590d7b56a889dde4a93b725e058 (patch) | |
tree | 2056664415cc39f4c2e8aede23cbde220886d2fc /ssl/ssl_ciph.c | |
parent | 2cc7acd273bc39f1360aed52400d18bb65b88a95 (diff) | |
download | openssl-5f3d93e4a336c590d7b56a889dde4a93b725e058.tar.gz |
Ensure all EVP calls have their returns checked where appropriate
There are lots of calls to EVP functions from within libssl There were
various places where we should probably check the return value but don't.
This adds these checks.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/ssl_ciph.c')
-rw-r--r-- | ssl/ssl_ciph.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 580178e085..fe30ab47a1 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -439,10 +439,11 @@ static int get_optional_pkey_id(const char *pkey_name) const EVP_PKEY_ASN1_METHOD *ameth; int pkey_id = 0; ameth = EVP_PKEY_asn1_find_str(NULL, pkey_name, -1); - if (ameth) { - EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth); + if (ameth && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, + ameth) > 0) { + return pkey_id; } - return pkey_id; + return 0; } #else @@ -454,7 +455,9 @@ static int get_optional_pkey_id(const char *pkey_name) int pkey_id = 0; ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1); if (ameth) { - EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth); + if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, + ameth) <= 0) + pkey_id = 0; } if (tmpeng) ENGINE_finish(tmpeng); |