From: "cron2 (Code Review)" Date: Tue, 3 Jun 2025 14:19:00 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606... Message-ID: <59033a806e023e2c90b5896c02fc1c5fa3cdcc27-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="czocMN/PNPA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: mbedtls: Allow TLS 1.3 if available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: MaxF Cc: flichtenheld , plaisthos , openvpn-devel --czocMN/PNPA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/10= 42?usp=3Demail ) Change subject: mbedtls: Allow TLS 1.3 if available ...................................................................... mbedtls: Allow TLS 1.3 if available We need mbedtls_ssl_export_keying_material() to support TLS 1.3. The workaround we use for TLS 1.2 does not work for TLS 1.3. Change-Id: If5e832866b312a2f8a1ce6b4e00d40e3dcf63681 Signed-off-by: Max Fillinger Acked-by: Frank Lichtenheld Message-Id: <20250603140631.11696-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 858.html Signed-off-by: Gert Doering --- M README.mbedtls M src/openvpn/ssl_mbedtls.c 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.mbedtls b/README.mbedtls index c4f3924..a1012e9 100644 --- a/README.mbedtls +++ b/README.mbedtls @@ -26,5 +26,9 @@ ************************************************************************* -Mbed TLS 3 has implemented (parts of) the TLS 1.3 protocol, but we have di= sabled -support in OpenVPN because the TLS-Exporter function is not yet implemente= d. +Mbed TLS 3 has implemented TLS 1.3, but support in OpenVPN requires the +function mbedtls_ssl_export_keying_material() which is currently not in +any released version. It is available when building mbed TLS from source +(mbedtls-3.6 or development branch). + +Without this function, only TLS 1.2 is available. diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index 7452c30..ecccc26 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -1048,11 +1048,14 @@ int tls_version_max(void) { -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) + /* We need mbedtls_ssl_export_keying_material() to support TLS 1.3. */ +#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_KEYING_MATERI= AL_EXPORT) + return TLS_VER_1_3; +#elif defined(MBEDTLS_SSL_PROTO_TLS1_2) return TLS_VER_1_2; -#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */ - #error "mbedtls is compiled without support for TLS 1.2." -#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */ +#else + #error mbedtls is compiled without support for TLS 1.2 or 1.3 +#endif } /** -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1042?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: If5e832866b312a2f8a1ce6b4e00d40e3dcf63681 Gerrit-Change-Number: 1042 Gerrit-PatchSet: 4 Gerrit-Owner: MaxF Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --czocMN/PNPA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

mbedtls: Allow TLS 1.3 if available

We= need mbedtls_ssl_export_keying_material() to support TLS 1.3. The
worka= round we use for TLS 1.2 does not work for TLS 1.3.

Change-Id: If5e8= 32866b312a2f8a1ce6b4e00d40e3dcf63681
Signed-off-by: Max Fillinger <ma= ximilian.fillinger@...2507...>
Acked-by: Frank Lichtenheld <frank@= ...2641...>
Message-Id: <20250603140631.11696-1-gert@...1296...>= ;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/= msg31858.html
Signed-off-by: Gert Doering <gert@...1296...>
---=
M README.mbedtls
M src/openvpn/ssl_mbedtls.c
2 files changed, 13 = insertions(+), 6 deletions(-)

diff --git a/README.mbedtls b/README.mbedtls
index c4f39= 24..a1012e9 100644
--- a/README.mbedtls
+++= b/README.mbedtls
@@ -26,5 +26,9 @@

***************************************************************= **********

-Mbed TLS 3 has implemented (parts of) the TLS 1.3 protocol, but we h= ave disabled
-support i= n OpenVPN because the TLS-Exporter function is not yet implemented.<= br>+Mbed TLS 3 has implemented = TLS 1.3, but support in OpenVPN requires the
+function mbedtls_ssl_export_keying_material() whic= h is currently not in
+any released version. It is available when building mbed TLS from source<= /span>
+(mbedtls-3.6 or deve= lopment branch).
+
+Without this function,= only TLS 1.2 is available.
diff --git a/src/openvpn/ssl_mb= edtls.c b/src/openvpn/ssl_mbedtls.c
index 7452c30..ecccc26 = 100644
--- a/src/openvpn/ssl_mbedtls.c
+++ = b/src/openvpn/ssl_mbedtls.c
@@ -1048,11 +1048,14 @@<= br> int
tls_version_max(void)
{

-#if defined(MBEDTLS_SSL_P= ROTO_TLS1_2)
+ /* = We need mbedtls_ssl_export_keying_material() to support TLS 1.3. */<= br>+#if defined(MBEDTLS_SSL_PRO= TO_TLS1_3) && defined(MBEDTLS_SSL_KEYING_MATERIAL_EXPORT)+ return TLS_VER_1_3;
+#elif defined(MBEDTLS_SSL= _PROTO_TLS1_2)
return TLS_VER_1_2;
-#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2= ) */
- #error "= mbedtls is compiled without support for TLS 1.2."
-#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2= ) */
+#else+ #error mbedtls is compile= d without support for TLS 1.2 or 1.3
+#endif
}

/**


To view, visit change 1042. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If5e832866b312a2f8a1ce6b4e00= d40e3dcf63681
Gerrit-Change-Number: 1042
Gerrit-PatchSet: 4
Gerrit-Owner: MaxF <max@...2606...>
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
--czocMN/PNPA=--