summaryrefslogtreecommitdiffstats
path: root/ssl/tls_depr.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-10-14 15:06:28 +0100
committerMatt Caswell <matt@openssl.org>2020-11-18 14:14:51 +0000
commit1b2b475517054d26a555269acacdb0ab7072bc6e (patch)
treeb665eefa97e4cb1a3f5573d77627af7ad28b27df /ssl/tls_depr.c
parent1ee22dc26873e68b73b693ffb5d99a6e9644b45f (diff)
Deprecate SSL_CTRL_SET_TMP_DH and other related ctrls
These ctrls pass around a DH object which is now deprecated, so we deprecate the ctrls themselves. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13368)
Diffstat (limited to 'ssl/tls_depr.c')
-rw-r--r--ssl/tls_depr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ssl/tls_depr.c b/ssl/tls_depr.c
index 3fcc5b6740..1ed47dd8de 100644
--- a/ssl/tls_depr.c
+++ b/ssl/tls_depr.c
@@ -142,5 +142,22 @@ HMAC_CTX *ssl_hmac_get0_HMAC_CTX(SSL_HMAC *ctx)
{
return ctx->old_ctx;
}
+
+/* Some deprecated public APIs pass DH objects */
+#ifndef OPENSSL_NO_DH
+EVP_PKEY *ssl_dh_to_pkey(DH *dh)
+{
+ EVP_PKEY *ret;
+
+ if (dh == NULL)
+ return NULL;
+ ret = EVP_PKEY_new();
+ if (EVP_PKEY_set1_DH(ret, dh) <= 0) {
+ EVP_PKEY_free(ret);
+ return NULL;
+ }
+ return ret;
+}
+#endif
#endif