tls: use default OpenSSL built-in DH parameters 14/33514/2
authorOfer Heifetz <oferh@marvell.com>
Sun, 25 Jul 2021 16:37:46 +0000 (19:37 +0300)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 30 Aug 2021 14:05:05 +0000 (14:05 +0000)
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 <oferh@marvell.com>
src/plugins/tlsopenssl/tls_openssl.c

index fa22343..3041047 100644 (file)
@@ -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
    */