diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-10-15 13:41:59 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-01-26 15:22:14 +0100 |
commit | 5b5eea4b60b682009d2b15587c9ceeae5e9c73f8 (patch) | |
tree | 4a3261cb27a582770270a07b40ecf05ecb71c89a /ssl/tls_depr.c | |
parent | 98dbf2c1c8143c0cc6dd05be7950d90bc6792064 (diff) |
Deprecate EC_KEY + Update ec apps to use EVP_PKEY
Co-author: Richard Levitte <levitte@openssl.org>
Co-author: Tomas Mraz <tmraz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13139)
Diffstat (limited to 'ssl/tls_depr.c')
-rw-r--r-- | ssl/tls_depr.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ssl/tls_depr.c b/ssl/tls_depr.c index 6f2103ad91..68b007b12d 100644 --- a/ssl/tls_depr.c +++ b/ssl/tls_depr.c @@ -159,5 +159,21 @@ EVP_PKEY *ssl_dh_to_pkey(DH *dh) return ret; } # endif -#endif +/* Some deprecated public APIs pass EC_KEY objects */ +# ifndef OPENSSL_NO_EC +EVP_PKEY *ssl_ecdh_to_pkey(EC_KEY *ec) +{ + EVP_PKEY *ret; + + if (ec == NULL) + return NULL; + ret = EVP_PKEY_new(); + if (EVP_PKEY_set1_EC_KEY(ret, ec) <= 0) { + EVP_PKEY_free(ret); + return NULL; + } + return ret; +} +# endif +#endif |