diff options
author | Richard Levitte <levitte@openssl.org> | 2020-03-18 15:54:47 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-04-08 15:30:25 +0200 |
commit | c2041da8c15027ddde5afcf9809d8d3a975eb25b (patch) | |
tree | bf9d645794fd9bdb554d7e09d4af0a04180905f5 /ssl/statem/statem_lib.c | |
parent | 4f76d62f2384d3335bd1d043706995ae64b37348 (diff) |
EVP & TLS: Add necessary EC_KEY data extraction functions, and use them
libssl code uses EVP_PKEY_get0_EC_KEY() to extract certain basic data
from the EC_KEY. We replace that with internal EVP_PKEY functions.
This may or may not be refactored later on.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11358)
Diffstat (limited to 'ssl/statem/statem_lib.c')
-rw-r--r-- | ssl/statem/statem_lib.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c index e9cfee027e..71a259e8f0 100644 --- a/ssl/statem/statem_lib.c +++ b/ssl/statem/statem_lib.c @@ -14,6 +14,7 @@ #include "../ssl_local.h" #include "statem_local.h" #include "internal/cryptlib.h" +#include "internal/evp.h" #include <openssl/buffer.h> #include <openssl/objects.h> #include <openssl/evp.h> @@ -1531,7 +1532,6 @@ static int is_tls13_capable(const SSL *s) int i; #ifndef OPENSSL_NO_EC int curve; - EC_KEY *eckey; #endif #ifndef OPENSSL_NO_PSK @@ -1563,10 +1563,8 @@ static int is_tls13_capable(const SSL *s) * more restrictive so check that our sig algs are consistent with this * EC cert. See section 4.2.3 of RFC8446. */ - eckey = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); - if (eckey == NULL) - continue; - curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(eckey)); + curve = evp_pkey_get_EC_KEY_curve_nid(s->cert->pkeys[SSL_PKEY_ECC] + .privatekey); if (tls_check_sigalg_curve(s, curve)) return 1; #else |