From 18599c5861d96723359997f2c70fc28fcac0e984 Mon Sep 17 00:00:00 2001 From: Ofer Heifetz Date: Sun, 25 Jul 2021 19:37:46 +0300 Subject: [PATCH] tls: use default OpenSSL built-in DH parameters Type: improvement Motivation for this addition is to add support for cipher suites that use Diffie-Hellman Ephemeral (DHE) for key exchange. Using ephemeral DH key exchange yields forward secrecy as the connection can only be decrypted when the DH key is known. Configure OpenSSL to use the default built-in DH parameters for the SSL_CTX object. Change-Id: I31aadad047a6394ddf8bfa08471c239e0d1cd63c Signed-off-by: Ofer Heifetz --- src/plugins/tlsopenssl/tls_openssl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c index fa223433c22..3041047a71e 100644 --- a/src/plugins/tlsopenssl/tls_openssl.c +++ b/src/plugins/tlsopenssl/tls_openssl.c @@ -749,6 +749,14 @@ openssl_start_listen (tls_ctx_t * lctx) return -1; } + /* use the default OpenSSL built-in DH parameters */ + rv = SSL_CTX_set_dh_auto (ssl_ctx, 1); + if (rv != 1) + { + TLS_DBG (1, "Couldn't set temp DH parameters"); + return -1; + } + /* * Set the key and cert */ -- 2.16.6