From: "plaisthos (Code Review)" Date: Fri, 2 May 2025 12:54:43 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="C6+hwFCd9rg="; 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: flichtenheld Cc: openvpn-devel --C6+hwFCd9rg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld,=20 I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/945?usp=3Demail to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld 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 --- M Changes.rst M doc/man-sections/tls-options.rst M src/openvpn/options.c 3 files changed, 17 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/945/3 diff --git a/Changes.rst b/Changes.rst index a4f5e57..0b0bbeb 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 specified. Modern TLS + implementations will prefer ECDH and other more modern algorithm 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..1ce6424 100644 --- a/doc/man-sections/tls-options.rst +++ b/doc/man-sections/tls-options.rst @@ -171,16 +171,21 @@ --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+). + use ECDH or newer hybrid key agreement algorithms like X25519MLKEM768). + 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 96119c4..f84d5f3 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3711,8 +3711,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: 3 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --C6+hwFCd9rg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

plaisthos uploaded patch set #3 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/945?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

Make --dh none behaviour default if not speci=
fied

Nowadays ciphers that are using still DH and not ECDH are rarel= y 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<= br>specifying --dh anymore.

Side note: Custom generated Diffie Hellm= ann parameters are also
discouraged nowadays. The newest OpenSSL FIPS li= braries even flat
out reject them:

FIPS 186-4 type domain para= meters 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 r= ecommended option as finite field Diffie
Hellmann is being deprecated an= yway
(https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete= -kex/)
and not supported by TLS 1.3 at all.

Change-Id: Ica02244c9= f0ac9b4690a51f940fda9d900465289
---
M Changes.rst
M doc/man-sectio= ns/tls-options.rst
M src/openvpn/options.c
3 files changed, 17 insert= ions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/o=
penvpn refs/changes/45/945/3
diff --git a/Changes.rst b/Changes.rst=

index a4f5e57..0b0bbeb 100644
--- a/Change= s.rst
+++ b/Changes.rst
@@ -103,6 +103,11 @= @
- ``--x509-username-field`` will no longer automatically= convert fieldnames to
uppercase. This is deprecated sin= ce OpenVPN 2.4, and has now been removed.

+- ``--dh none`` is now the default = if ``--dh`` is specified. Modern TLS
+ implementations will prefer ECDH and other more modern a= lgorithm anyway.
+ A= nd finite field Diffie Hellman is in the proces of being deprecated<= br>+ (see draft-ietf-tls-depre= cate-obsolete-kex)
+<= /span>
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/d= oc/man-sections/tls-options.rst
index 0638d09..1ce6424 1006= 44
--- a/doc/man-sections/tls-options.rst
+= ++ b/doc/man-sections/tls-options.rst
@@ -171,16 +171,21 @@=


--dh file
<= span style=3D"color: hsl(0, 100%, 40%);">- File containing Diffie Hellman = parameters in .pem format (required for

- ``--tls-server`` only).
+ File containing finite field Diffie Hellman param= eters in .pem format (used
+ by ``--tls-server`` only).

Se= t ``file`` to :code:`none` to disable Diffie Hellman key exchange (and
- use ECDH only). Note tha= t this requires peers to be using an SSL library
- that supports ECDH TLS cipher suites (e.g. Ope= nSSL 1.0.1+, or
- mbed= TLS 2.0+).
+ use EC= DH or newer hybrid key agreement algorithms like X25519MLKEM768).+ Note that this requires pee= rs to be using an SSL library that supports
+ ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or m= bed TLS 2.0+). Starting
+ with 2.7.0, this is the same as not specifying ``--dh`` at all.


- Use ``o= penssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH
- parameters. Diffie Hellman parame= ters may be considered public.
+ Diffie Hellman parameters can be generated using
+ ``openssl dhparam -out dh2048.p= em 2048`` but it is recommended to
+ use ``none`` as finite field Diffie Hellman have been repl= aced
+ by more moder= n variants like ECDH.
+
+ Diffie Hellman = parameters may be considered public.

--e= cdh-curve name
Specify the curve to use for elliptic cur= ve Diffie Hellman. Available
diff --git a/src/openvpn/optio= ns.c b/src/openvpn/options.c
index 96119c4..f84d5f3 100644<= /span>
--- a/src/openvpn/options.c
+++ b/src/openv= pn/options.c
@@ -3711,8 +3711,6 @@
=
if (o->tls_server)
{
- /* Check that DH file is spec= ified, 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: 3
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--C6+hwFCd9rg=--