summaryrefslogtreecommitdiffstats
path: root/tcpd/libcouriertls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcpd/libcouriertls.c')
-rw-r--r--tcpd/libcouriertls.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tcpd/libcouriertls.c b/tcpd/libcouriertls.c
index 7c42f19..9c2847a 100644
--- a/tcpd/libcouriertls.c
+++ b/tcpd/libcouriertls.c
@@ -409,19 +409,39 @@ static void load_dh_params(SSL_CTX *ctx, const char *filename,
const struct tls_info *info=SSL_CTX_get_app_data(ctx);
BIO *bio;
- DH *dh;
if (*cert_file_flags)
return;
if ((bio=BIO_new_file(filename, "r")) != 0)
{
+#if HAVE_PEM_READ_BIO_PARAMETERS_EX
+
+ OSSL_LIB_CTX *libctx=OSSL_LIB_CTX_get0_global_default();
+
+ EVP_PKEY *pkey=PEM_read_bio_Parameters_ex(bio, NULL, libctx,
+ NULL);
+
+ if (pkey)
+ {
+ if (EVP_PKEY_is_a(pkey, "DH"))
+ {
+ SSL_CTX_set0_tmp_dh_pkey(ctx, pkey);
+ *cert_file_flags = 1;
+ }
+ EVP_PKEY_free(pkey);
+ }
+
+#else
+ DH *dh;
+
if ((dh=PEM_read_bio_DHparams(bio, NULL, NULL, NULL)) != 0)
{
SSL_CTX_set_tmp_dh(ctx, dh);
*cert_file_flags = 1;
DH_free(dh);
}
+#endif
else
{
/*