Skip to contentSkip to conversation

Change in openvpn[master]: mbedtls: Remove support for old TLS versions

Openvpn-devel In review MaxF (Code Review) 4 participants 10 messages Jun 14, 2024 – Jun 20, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1718364874000.Ia3883a26ac26df6bbb5353fb074a2e0f814737be@...2715...

#1 lore raw

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/+/682?usp=email

to review the following change.

Change subject: mbedtls: Remove support for old TLS versions
......................................................................

mbedtls: Remove support for old TLS versions

Recent versions of mbedtls have dropped support for TLS 1.0 and 1.1. Rather than checking which versions are supported, drop support for everything before 1.2.

Change-Id Ia3883a26ac26df6bbb5353fb074a2e0f814737be

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 1 insertion(+), 20 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/682/1

src/openvpn/ssl_mbedtls.c +1 -20
index a68588e..e25fb84 100644
@@ -1040,12 +1040,8 @@
 {
 #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 /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
-    #error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2."
+    #error "mbedtls is compiled without support for TLS 1.2."
 #endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
 }
 
@@ -1067,27 +1063,12 @@
 
     switch (tls_ver)
     {
-#if defined(MBEDTLS_SSL_PROTO_TLS1)
-        case TLS_VER_1_0:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_1;
-            break;
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
-        case TLS_VER_1_1:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_2;
-            break;
-#endif
-
 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
         case TLS_VER_1_2:
             *major = MBEDTLS_SSL_MAJOR_VERSION_3;
             *minor = MBEDTLS_SSL_MINOR_VERSION_3;
             break;
 #endif
-
         default:
             msg(M_FATAL, "%s: invalid or unsupported TLS version %d", __func__, tls_ver);
             break;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/682?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3883a26ac26df6bbb5353fb074a2e0f814737be
Gerrit-Change-Number: 682
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/682?usp=email

to look at the new patch set (#2).

Change subject: mbedtls: Remove support for old TLS versions
......................................................................

mbedtls: Remove support for old TLS versions

Recent versions of mbedtls have dropped support for TLS 1.0 and 1.1. Rather than checking which versions are supported, drop support for everything before 1.2.

Change-Id Ia3883a26ac26df6bbb5353fb074a2e0f814737be

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 1 insertion(+), 19 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/682/2

src/openvpn/ssl_mbedtls.c +1 -19
index a68588e..ec9ec13 100644
@@ -1040,12 +1040,8 @@
 {
 #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 /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
-    #error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2."
+    #error "mbedtls is compiled without support for TLS 1.2."
 #endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
 }
 
@@ -1067,20 +1063,6 @@
 
     switch (tls_ver)
     {
-#if defined(MBEDTLS_SSL_PROTO_TLS1)
-        case TLS_VER_1_0:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_1;
-            break;
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
-        case TLS_VER_1_1:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_2;
-            break;
-#endif
-
 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
         case TLS_VER_1_2:
             *major = MBEDTLS_SSL_MAJOR_VERSION_3;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/682?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3883a26ac26df6bbb5353fb074a2e0f814737be
Gerrit-Change-Number: 682
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: MaxF, flichtenheld.

plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/682?usp=email )

Change subject: mbedtls: Remove support for old TLS versions
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/682?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3883a26ac26df6bbb5353fb074a2e0f814737be
Gerrit-Change-Number: 682
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Tue, 18 Jun 2024 11:52:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#4 lore raw

PATCH v2 1/1 mbedtls: Remove support for old TLS versions

In reply to a message not in the archive

From: Max Fillinger <[email protected]...>

Recent versions of mbedtls have dropped support for TLS 1.0 and 1.1. Rather than checking which versions are supported, drop support for everything before 1.2.

Change-Id Ia3883a26ac26df6bbb5353fb074a2e0f814737be

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/682
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>

src/openvpn/ssl_mbedtls.c +1 -19
index a68588e..ec9ec13 100644
@@ -1040,12 +1040,8 @@
 {
 #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 /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
-    #error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2."
+    #error "mbedtls is compiled without support for TLS 1.2."
 #endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
 }
 
@@ -1067,20 +1063,6 @@
 
     switch (tls_ver)
     {
-#if defined(MBEDTLS_SSL_PROTO_TLS1)
-        case TLS_VER_1_0:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_1;
-            break;
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
-        case TLS_VER_1_1:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_2;
-            break;
-#endif
-
 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
         case TLS_VER_1_2:
             *major = MBEDTLS_SSL_MAJOR_VERSION_3;
#5 lore raw

[Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

Mildly tested via GHA builds.

Not sure we want this in release/2.6 - I tend to "not", because it might break someone's (non-recommended) setup...

Your patch has been applied to the master branch.

commit 013c119af96bc57c41e04e4a8f64b5d80e2e9ba6

Author: Max Fillinger
Date:   Tue Jun 18 14:02:19 2024 +0200
     mbedtls: Remove support for old TLS versions

     Signed-off-by: Max Fillinger <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28773.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#6 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

Hi,

this breaks *all* client connects on my server testbed. No matter if 2.2 or 2.5 client, when building with mbedtls (2.28.7), the resulting binary refuses ALL incoming connection with

Jun 19 10:21:44 gentoo tap-udp-p2mp[1723]: 2001:608:0:814::f000:16 tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:21:44 gentoo tap-tcp-p2p[1770]: tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:21:59 gentoo tun-tcp-p2mp[1708]: tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:22:32 gentoo tun-udp-p2mp[1713]: 194.97.140.21:49229 tls_version_to_ssl_version: invalid or unsupported TLS version 2
Jun 19 10:23:05 gentoo tun-udp-p2mp-topology-subnet[1718]: 194.97.140.21:45789 tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:24:11 gentoo tun-udp-p2mp-fragment[1746]: 194.97.140.21:14517 tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:44:49 gentoo tun-udp-p2mp-112-mask[1741]: 194.97.140.21:42810 tls_version_to_ssl_version: invalid or unsupported TLS version 1

so my guess would be that on mbedTLS builds that *do* support 1.1/1.2, incoming client connects with 1.1/1.2 cause "something to get upset" in the TLS version printer.

Sorry for not testing this more thoroughly before merging.

gert

Quoted 32 lines · Gert Doering

Mildly tested via GHA builds.

Not sure we want this in release/2.6 - I tend to "not", because it might break someone's (non-recommended) setup...

Your patch has been applied to the master branch.

commit 013c119af96bc57c41e04e4a8f64b5d80e2e9ba6

Author: Max Fillinger
Date:   Tue Jun 18 14:02:19 2024 +0200
     mbedtls: Remove support for old TLS versions

     Signed-off-by: Max Fillinger <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28773.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#7 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

Hi,

I *think* I reproduced the problem you're encountering.

If I put

setenv opt tls-version-min 1.0

in the server config, then *every* connection attempt will trigger a fatal error in the server. Doesn't matter what TLS versions the client supports.

If I put that option into the client config, the client will exit with an error during startup.

It's not clear to me what the expected behavior is when tls-version-min is an unsupported version, but if it's an error, it should happen during start-up.

Quoted 87 lines

-----Original Message-----
From: Gert Doering <[email protected]...>
Sent: woensdag 19 juni 2024 11:44
To: Maximilian Fillinger <[email protected]...>
Cc: [email protected]
Subject: Re: [Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

Hi,

this breaks *all* client connects on my server testbed. No matter if 2.2 or 2.5 client, when building with mbedtls (2.28.7), the resulting binary refuses ALL incoming connection with

Jun 19 10:21:44 gentoo tap-udp-p2mp[1723]: 2001:608:0:814::f000:16
tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:21:44 gentoo tap-tcp-p2p[1770]: tls_version_to_ssl_version:
invalid or unsupported TLS version 1
Jun 19 10:21:59 gentoo tun-tcp-p2mp[1708]: tls_version_to_ssl_version:
invalid or unsupported TLS version 1
Jun 19 10:22:32 gentoo tun-udp-p2mp[1713]: 194.97.140.21:49229
tls_version_to_ssl_version: invalid or unsupported TLS version 2
Jun 19 10:23:05 gentoo tun-udp-p2mp-topology-subnet[1718]:
194.97.140.21:45789 tls_version_to_ssl_version: invalid or unsupported
TLS version 1
Jun 19 10:24:11 gentoo tun-udp-p2mp-fragment[1746]: 194.97.140.21:14517
tls_version_to_ssl_version: invalid or unsupported TLS version 1
Jun 19 10:44:49 gentoo tun-udp-p2mp-112-mask[1741]: 194.97.140.21:42810

tls_version_to_ssl_version: invalid or unsupported TLS version 1

so my guess would be that on mbedTLS builds that *do* support 1.1/1.2, incoming client connects with 1.1/1.2 cause "something to get upset" in the TLS version printer.

Sorry for not testing this more thoroughly before merging.

gert

Quoted 3 lines · Gert Doering

Mildly tested via GHA builds.

Not sure we want this in release/2.6 - I tend to "not", because it

might

Quoted 8 lines

break someone's (non-recommended) setup...

Your patch has been applied to the master branch.

commit 013c119af96bc57c41e04e4a8f64b5d80e2e9ba6

Author: Max Fillinger
Date:   Tue Jun 18 14:02:19 2024 +0200
Quoted 6 lines
     mbedtls: Remove support for old TLS versions

     Signed-off-by: Max Fillinger <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/openvpn-

[email protected]/msg28773.html

Quoted 6 lines
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Quoted 9 lines

Gert Doering

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never
doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh
Mistress

Gert Doering - Munich, Germany
[email protected]...

#8 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

Hi,

Quoted 11 lines · Maximilian Fillinger

I *think* I reproduced the problem you're encountering.

If I put

setenv opt tls-version-min 1.0

in the server config, then *every* connection attempt will trigger a fatal error in the server. Doesn't matter what TLS versions the client supports.

If I put that option into the client config, the client will exit with an error during startup.

It's not clear to me what the expected behavior is when tls-version-min is an unsupported version, but if it's an error, it should happen during start-up.

I would argue for

- we log "minimum supported version is 1.2" and go on

or

- we log "minimum supported version is 1.2" and exit

both is acceptable. It will break people's setups in different ways, though... the first will pretend all is well, and older clients can no longer connect, while the second one will break everything, so making it more obvious.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#9 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: mbedtls: Remove support for old TLS versions

it should happen during start-up.

Quoted 4 lines

I would argue for

- we log "minimum supported version is 1.2" and go on

Quoted 9 lines

or

- we log "minimum supported version is 1.2" and exit

both is acceptable. It will break people's setups in different ways, though... the first will pretend all is well, and older clients can no longer connect, while the second one will break everything, so making it more obvious.

Strong vote for going on. On many OpenSSL configuration and also distribution trying to use TLS 1.0 will already silently give you only TLS 1.2+. So no reason to behave different with mbed TLS.

Arne

#10 lore raw
In reply to a message not in the archive

MaxF has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/682?usp=email )

Change subject: mbedtls: Remove support for old TLS versions
......................................................................

mbedtls: Remove support for old TLS versions

Recent versions of mbedtls have dropped support for TLS 1.0 and 1.1. Rather than checking which versions are supported, drop support for everything before 1.2.

Change-Id Ia3883a26ac26df6bbb5353fb074a2e0f814737be

Reviewed-on: http://gerrit.openvpn.net/c/openvpn/+/682

---
M src/openvpn/ssl_mbedtls.c

1 file changed, 1 insertion(+), 19 deletions(-)

Approvals:
plaisthos: Looks good to me, approved

src/openvpn/ssl_mbedtls.c +1 -19
index a68588e..ec9ec13 100644
@@ -1040,12 +1040,8 @@
 {
 #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 /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
-    #error "mbedtls is compiled without support for TLS 1.0, 1.1 and 1.2."
+    #error "mbedtls is compiled without support for TLS 1.2."
 #endif /* defined(MBEDTLS_SSL_PROTO_TLS1_2) */
 }
 
@@ -1067,20 +1063,6 @@
 
     switch (tls_ver)
     {
-#if defined(MBEDTLS_SSL_PROTO_TLS1)
-        case TLS_VER_1_0:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_1;
-            break;
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_1)
-        case TLS_VER_1_1:
-            *major = MBEDTLS_SSL_MAJOR_VERSION_3;
-            *minor = MBEDTLS_SSL_MINOR_VERSION_2;
-            break;
-#endif
-
 #if defined(MBEDTLS_SSL_PROTO_TLS1_2)
         case TLS_VER_1_2:
             *major = MBEDTLS_SSL_MAJOR_VERSION_3;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/682?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3883a26ac26df6bbb5353fb074a2e0f814737be
Gerrit-Change-Number: 682
Gerrit-PatchSet: 3
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: MaxF <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged