From: "cron2 (Code Review)" Date: Mon, 19 May 2025 09:52:26 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <1c07b0f6517e687e62b52db9dfddf9ce135bbdc8-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="jKOofxTeaKE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Make --dh none behaviour default if not specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --jKOofxTeaKE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/94= 5?usp=3Demail ) Change subject: Make --dh none behaviour default if not specified ...................................................................... Make --dh none behaviour default if not specified Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore. Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them: FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5 But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway (https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/) and not supported by TLS 1.3 at all. Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20250518220245.24489-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 695.html Signed-off-by: Gert Doering --- M Changes.rst M doc/man-sections/tls-options.rst M src/openvpn/options.c 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Changes.rst b/Changes.rst index a4f5e57..e297334 100644 --- a/Changes.rst +++ b/Changes.rst @@ -103,6 +103,11 @@ - ``--x509-username-field`` will no longer automatically convert fieldname= s to uppercase. This is deprecated since OpenVPN 2.4, and has now been remove= d. +- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS + implementations will prefer ECDH and other more modern algorithms anyway. + And finite field Diffie Hellman is in the proces of being deprecated + (see draft-ietf-tls-deprecate-obsolete-kex) + Overview of changes in 2.6 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D diff --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-option= s.rst index 0638d09..db107e6 100644 --- a/doc/man-sections/tls-options.rst +++ b/doc/man-sections/tls-options.rst @@ -171,16 +171,22 @@ --dh file - File containing Diffie Hellman parameters in .pem format (required for - ``--tls-server`` only). + File containing finite field Diffie Hellman parameters in .pem format (u= sed + by ``--tls-server`` only). - Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and - use ECDH only). Note that this requires peers to be using an SSL library - that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or - mbed TLS 2.0+). + Set ``file`` to :code:`none` to disable fine field Diffie Hellman + key exchange (and to only use ECDH or newer hybrid key agreement algorit= hms + like X25519MLKEM768 instead). + Note that this requires peers to be using an SSL library that supports + ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting + with 2.7.0, this is the same as not specifying ``--dh`` at all. - Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH - parameters. Diffie Hellman parameters may be considered public. + Diffie Hellman parameters can be generated using + ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to + use ``none`` as finite field Diffie Hellman have been replaced + by more modern variants like ECDH. + + Diffie Hellman parameters may be considered public. --ecdh-curve name Specify the curve to use for elliptic curve Diffie Hellman. Available diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 810bb56..6672b5c 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3703,8 +3703,6 @@ if (o->tls_server) { - /* Check that DH file is specified, or explicitly disabled */ - notnull(o->dh_file, "DH file (--dh)"); if (streq(o->dh_file, "none")) { o->dh_file =3D NULL; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289 Gerrit-Change-Number: 945 Gerrit-PatchSet: 5 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --jKOofxTeaKE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Make --dh none behaviour default if not specif=
ied

Nowadays ciphers that are using still DH and not ECDH are rarely= chosen
as best cipher suite. Our man page even indicates that OpenSSL 1= .0.1+
supports ECDH cipher suites. So it does not feel useful to forcespecifying --dh anymore.

Side note: Custom generated Diffie Hellma= nn parameters are also
discouraged nowadays. The newest OpenSSL FIPS lib= raries even flat
out reject them:

FIPS 186-4 type domain param= eters no longer allowed in FIPS mode,
since the required validation r= outines were removed from FIPS 186-5

But instead of adding support f= or loading the well-known curve just make
dh none the default and the re= commended option as finite field Diffie
Hellmann is being deprecated any= way
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-= kex/)
and not supported by TLS 1.3 at all.

Change-Id: Ica02244c9f= 0ac9b4690a51f940fda9d900465289
Signed-off-by: Arne Schwabe <arne-open= vpn@...1227...>
Acked-by: Gert Doering <gert@...1296...>
Mes= sage-Id: <20250518220245.24489-1-gert@...1296...>
URL: https://www= .mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31695.html
Sign= ed-off-by: Gert Doering <gert@...1296...>
---
M Changes.rst
= M doc/man-sections/tls-options.rst
M src/openvpn/options.c
3 files ch= anged, 19 insertions(+), 10 deletions(-)

diff --git a/Changes.rst b/Changes.rst
index a4f5e57..e2= 97334 100644
--- a/Changes.rst
+++ b/Change= s.rst
@@ -103,6 +103,11 @@
- ``--x509-user= name-field`` will no longer automatically convert fieldnames to
<= span> uppercase. This is deprecated since OpenVPN 2.4, and has now been r= emoved.

+- ``--dh none`` is now the default if ``--dh`` is not specified. Mode= rn TLS
+ implementat= ions will prefer ECDH and other more modern algorithms anyway.
+ And finite field Diffie Hellma= n is in the proces of being deprecated
+ (see draft-ietf-tls-deprecate-obsolete-kex)
= +
Overview of = changes in 2.6
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

diff= --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-options.rs= t
index 0638d09..db107e6 100644
--- a/doc/m= an-sections/tls-options.rst
+++ b/doc/man-sections/tls-opti= ons.rst
@@ -171,16 +171,22 @@

<= span>
--dh file
- File containing Diffie Hellman parameters in .pem format (req= uired for
- ``--tls-se= rver`` only).
+ File= containing finite field Diffie Hellman parameters in .pem format (used

+ by ``--tls-server`` o= nly).

- Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (an= d
- use ECDH only). No= te that this requires peers to be using an SSL library
- that supports ECDH TLS cipher suites (e.= g. OpenSSL 1.0.1+, or
-= mbed TLS 2.0+).
+ = Set ``file`` to :code:`none` to disable fine field Diffie Hellman+ key exchange (and to only u= se ECDH or newer hybrid key agreement algorithms
+ like X25519MLKEM768 instead).
+ Note that this requires peers to= be using an SSL library that supports
+ ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed T= LS 2.0+). Starting
+ = with 2.7.0, this is the same as not specifying ``--dh`` at all.
=
- Use ``openss= l dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
- parameters. Diffie Hellman parameters = may be considered public.
+ Diffie Hellman parameters can be generated using
+ ``openssl dhparam -out dh2048.pem 20= 48`` but it is recommended to
+ use ``none`` as finite field Diffie Hellman have been replaced<= /span>
+ by more modern var= iants like ECDH.
+
+ Diffie Hellman param= eters may be considered public.

--ecdh-c= urve name
Specify the curve to use for elliptic curve Di= ffie Hellman. Available
diff --git a/src/openvpn/options.c = b/src/openvpn/options.c
index 810bb56..6672b5c 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/op= tions.c
@@ -3703,8 +3703,6 @@

<= span> if (o->tls_server)

{
- /* Check that DH file is specified= , or explicitly disabled */
- notnull(o->dh_file, "DH file (--dh)"); if (streq(o->dh_file, "none"))
{

o->dh_file =3D NULL;
=

To view, visit change 945. To unsubscribe, or for help= writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ica02244c9f0ac9b4690a51f940f= da9d900465289
Gerrit-Change-Number: 945
Gerrit-PatchSet: 5
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--jKOofxTeaKE=--