From: Ofer Heifetz Date: Sun, 25 Jul 2021 16:37:46 +0000 (+0300) Subject: tls: use default OpenSSL built-in DH parameters X-Git-Tag: v22.02-rc0~89 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=18599c5861d96723359997f2c70fc28fcac0e984;p=vpp.git 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 --- 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 */