From: "MaxF (Code Review)" Date: Wed, 3 Jul 2024 15:37:02 +0000 References: Reply-To: max@...2606..., 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="K9qZoId7Pok="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: mbedtls: Warn if --tls-version-min is too low List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --K9qZoId7Pok= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/684?usp=3Demail to review the following change. Change subject: mbedtls: Warn if --tls-version-min is too low ...................................................................... mbedtls: Warn if --tls-version-min is too low Recent versions of mbedtls only support TLS 1.2. When the minimum version is set to TLS 1.0 or 1.1, log a warning and use 1.2 as the actual minimum version. Change-Id: Ibc641388d8016533c94dfef3618376f6dfa91f4e Signed-off-by: Max Fillinger --- M src/openvpn/options.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/84/684/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index dbe1425..64e67aa 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -8942,6 +8942,15 @@ msg(msglevel, "unknown tls-version-min parameter: %s", p[1]); goto err; } + +#ifdef ENABLE_CRYPTO_MBEDTLS + if (ver < TLS_VER_1_2) + { + msg(M_WARN, "--tls-version-min %s is not supported by mbedtls,= using 1.2", p[1]); + ver =3D TLS_VER_1_2; + } +#endif + options->ssl_flags &=3D ~(SSLF_TLS_VERSION_MIN_MASK << SSLF_TLS_VERSION_MIN_SHIFT); options->ssl_flags |=3D (ver << SSLF_TLS_VERSION_MIN_SHIFT); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/684?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: Ibc641388d8016533c94dfef3618376f6dfa91f4e Gerrit-Change-Number: 684 Gerrit-PatchSet: 1 Gerrit-Owner: MaxF Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --K9qZoId7Pok= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

MaxF would like plaisthos and flichtenheld to review th= is change.

Vi= ew Change

mbedtls: Warn if --tls-version-min is too low

Recent v= ersions of mbedtls only support TLS 1.2. When the minimum
version is set= to TLS 1.0 or 1.1, log a warning and use 1.2 as the
actual minimum vers= ion.

Change-Id: Ibc641388d8016533c94dfef3618376f6dfa91f4e
Signed-= off-by: Max Fillinger <maximilian.fillinger@...2507...>
---
M s= rc/openvpn/options.c
1 file changed, 9 insertions(+), 0 deletions(-)
=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/84/684/=
1
diff --git a/src/openvpn/options.c b/src/openvpn/options.c=

index dbe1425..64e67aa 100644
--- a/src/openvpn/o= ptions.c
+++ b/src/openvpn/options.c
@@ -89= 42,6 +8942,15 @@
msg(msglevel, "unknown t= ls-version-min parameter: %s", p[1]);
got= o err;
}
+
+#ifde= f ENABLE_CRYPTO_MBEDTLS
+ if (ver < TLS_VER_1_2)
+ {
+ msg(M_WARN, "--tls-version-min %s is not supported= by mbedtls, using 1.2", p[1]);
+ ver =3D TLS_VER_1_2;
+ }
+#endif
+
options->ssl_flags &=3D
<= span> ~(SSLF_TLS_VERSION_MIN_MASK << SSLF_TLS_VERSION_MIN= _SHIFT);
options->ssl_flags |=3D (ver << = SSLF_TLS_VERSION_MIN_SHIFT);

To view, v= isit chan= ge 684. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibc641388d8016533c94dfef3618= 376f6dfa91f4e
Gerrit-Change-Number: 684
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <max@...2606...>
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: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--K9qZoId7Pok=--