From: "cron2 (Code Review)" Date: Wed, 15 Nov 2023 16:14:31 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606... Message-ID: <1908ed1b9b272b4a0d65046984b00795047081ce-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="E+zWCASIQgE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Disable TLS 1.3 support with mbed TLS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: MaxF , plaisthos , flichtenheld Cc: openvpn-devel --E+zWCASIQgE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#6) to the change originally created by= MaxF. ( http://gerrit.openvpn.net/c/openvpn/+/403?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Disable TLS 1.3 support with mbed TLS ...................................................................... Disable TLS 1.3 support with mbed TLS As of version 3.5.0 the TLS-Exporter function is not yet implemented in mbed TLS, and the exporter_master_secret is not exposed to the application either. Falling back to an older PRF when claiming to use TLS1.3 seems like false advertising. Change-Id: If4e1c4af9831eb1090ccb3a3c4d3e76b413f0708 Signed-off-by: Max Fillinger Acked-by: Frank Lichtenheld Message-Id: <20231115151740.23948-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 453.html Signed-off-by: Gert Doering --- M README.mbedtls M src/openvpn/ssl_mbedtls.c 2 files changed, 6 insertions(+), 29 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/03/403/6 diff --git a/README.mbedtls b/README.mbedtls index 9b75c2b..ed9d369 100644 --- a/README.mbedtls +++ b/README.mbedtls @@ -43,19 +43,5 @@ ************************************************************************* -Mbed TLS 3 supports the TLS 1.3 protocol, but the implementation is not yet -complete. Therefore, using TLS 1.3 in the mbed TLS build of OpenVPN is not= yet -supported. - -Nevertheless, here are some pointers to make it work with mbed TLS 3.5.0: - - * The stock configuration of mbed TLS does not support TLS 1.3. To enable= it, - uncomment `#define MBEDTLS_SSL_PROTO_TLS1_3` in your mbedtls_config.h b= efore - compiling the library. - * An OpenVPN client with mbed TLS cannot connect to a server with OpenSSL - using TLS 1.3. - * An OpenVPN client with OpenSSL *can* connect to a server using mbed TLS= with - TLS 1.3, but *only* if `#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE` = has - been uncommented in mbedtls_config.h. - -Note that none of these limitations apply to TLS 1.2. +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. diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index 4ece37e..6a3cd44 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -980,17 +980,15 @@ int tls_version_max(void) { -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) - return TLS_VER_1_3; -#elif defined(MBEDTLS_SSL_PROTO_TLS1_2) +#if defined(MBEDTLS_SSL_PROTO_TLS1_2) return TLS_VER_1_2; #elif defined(MBEDTLS_SSL_PROTO_TLS1_1) return TLS_VER_1_1; #elif defined(MBEDTLS_SSL_PROTO_TLS1) return TLS_VER_1_0; -#else /* if defined(MBEDTLS_SSL_PROTO_TLS1_3) */ - #error "mbedtls is compiled without support for any version of TLS." -#endif +#else /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */ + #error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2." +#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */ } /** @@ -1032,13 +1030,6 @@ break; #endif -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) - case TLS_VER_1_3: - *major =3D MBEDTLS_SSL_MAJOR_VERSION_3; - *minor =3D MBEDTLS_SSL_MINOR_VERSION_4; - break; -#endif - default: msg(M_FATAL, "%s: invalid or unsupported TLS version %d", __fu= nc__, tls_ver); break; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/403?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: If4e1c4af9831eb1090ccb3a3c4d3e76b413f0708 Gerrit-Change-Number: 403 Gerrit-PatchSet: 6 Gerrit-Owner: MaxF Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --E+zWCASIQgE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #6 to the change originally cr= eated by MaxF.

View Change

The following approvals got outdated and = were removed: Code-Review+2 by flichtenheld

Disable TLS 1.3 support with mbed TLS

= As of version 3.5.0 the TLS-Exporter function is not yet implemented in
= mbed TLS, and the exporter_master_secret is not exposed to the
applicati= on either. Falling back to an older PRF when claiming to use
TLS1.3 seem= s like false advertising.

Change-Id: If4e1c4af9831eb1090ccb3a3c4d3e7= 6b413f0708
Signed-off-by: Max Fillinger <maximilian.fillinger@...2754...= ...>
Acked-by: Frank Lichtenheld <frank@...2641...>
Message-= Id: <20231115151740.23948-1-gert@...1296...>
URL: https://www.mail= -archive.com/openvpn-devel@lists.sourceforge.net/msg27453.html
Signed-of= f-by: Gert Doering <gert@...1296...>
---
M README.mbedtls
M = src/openvpn/ssl_mbedtls.c
2 files changed, 6 insertions(+), 29 deletions= (-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/=
03/403/6
diff --git a/README.mbedtls b/README.mbedtls
index 9b75c2b..ed9d369 100644
--- a/README.mbedtls
+++ b/README.mbedtls
@@ -43,19 +43,5 @@
************************************************= *************************

-Mbed TLS 3 supports the TLS 1.3 protocol, but the imp= lementation is not yet
= -complete. Therefore, using TLS 1.3 in the mbed TLS build of OpenVPN is not= yet
-supported.=
-
-Nevertheless, here are some pointers to make it w= ork with mbed TLS 3.5.0:
- * The stock confi= guration of mbed TLS does not support TLS 1.3. To enable it,
- uncomment `#define MBEDTLS_SSL_PR= OTO_TLS1_3` in your mbedtls_config.h before

- compiling the library.
- * An OpenVPN client with mbed TLS cannot connect= to a server with OpenSSL
- using TLS 1.3.
-= * An OpenVPN client with OpenSSL *can* connect to a server using mbed TLS = with
- TLS 1.3, but *= only* if `#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE` has
- been uncommented in mbedtls_confi= g.h.
-
-Note that none of these limitations ap= ply to TLS 1.2.
+Mbed= TLS 3 has implemented (parts of) the TLS 1.3 protocol, but we have disable= d
+support in OpenVPN= because the TLS-Exporter function is not yet implemented.
= diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.cindex 4ece37e..6a3cd44 100644
--- a/src/openvpn/ssl= _mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
= @@ -980,17 +980,15 @@
int
tls_version_max= (void)
{
-#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
- return TLS_VER_1_3;
-#elif defined(MBEDTLS_SSL_PROTO_TLS1_2)
+#if defined(MBEDTLS_SSL_PROTO_TLS= 1_2)
return TLS_VER_1_2;
#elif define= d(MBEDTLS_SSL_PROTO_TLS1_1)
return TLS_VER_1_1;=
#elif defined(MBEDTLS_SSL_PROTO_TLS1)
retur= n TLS_VER_1_0;
-#else /= * if defined(MBEDTLS_SSL_PROTO_TLS1_3) */
- #error "mbedtls is compiled without support fo= r any version of TLS."
-#endif
+#else /= * defined(MBEDTLS_SSL_PROTO_TLS1_2) */
+ #error "mbedtls is compiled without support for= TLS 1.0, 1.1 and 1.2."
+#endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
}<= /span>

/**
@@ -1032,13 +1030,6 = @@
break;
#endif

-#if defined(MBED= TLS_SSL_PROTO_TLS1_3)
-= case TLS_VER_1_3:
- *major =3D MBEDTLS_SSL_MAJOR_VERSION_3;
- *minor =3D MBEDTLS_SSL_MINOR_= VERSION_4;
- = break;
-#endif<= br>-
def= ault:
msg(M_FATAL, "%s: invalid or unsupp= orted TLS version %d", __func__, tls_ver);
= break;

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If4e1c4af9831eb1090ccb3a3c4d= 3e76b413f0708
Gerrit-Change-Number: 403
Gerrit-PatchSet: 6
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-MessageType: newpatchset
--E+zWCASIQgE=--