From: "flichtenheld (Code Review)"
Date: Thu, 27 Mar 2025 09:11:24 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net, max@...2606...
Message-ID: <18e39987c4d60d5b766c99061949372d072fc616-EmailReplacePatchSet-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="+FneMv1VAA8="; charset=UTF-8
Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix compatibility
with mbedTLS 2.28.10+ and 3.6.3+
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: plaisthos
Cc: openvpn-devel , MaxF
--+FneMv1VAA8=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: flichtenheld.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/918?usp=3Demail
to look at the new patch set (#2).
Change subject: Fix compatibility with mbedTLS 2.28.10+ and 3.6.3+
......................................................................
Fix compatibility with mbedTLS 2.28.10+ and 3.6.3+
From release notes:
In TLS clients, if mbedtls_ssl_set_hostname() has not been called,
mbedtls_ssl_handshake() now fails with
MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
if certificate-based authentication of the server is attempted.
This is because authenticating a server without knowing what name
to expect is usually insecure. To restore the old behavior, either
call mbedtls_ssl_set_hostname() with NULL as the hostname [...]
Change-Id: I8bbb6ffdac7d0029dbf3c13e62c11b61813c15ef
Signed-off-by: Frank Lichtenheld
---
M src/openvpn/ssl_mbedtls.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/18/918/2
diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index 92b52fe..c31079e 100644
--- a/src/openvpn/ssl_mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
@@ -1246,6 +1246,10 @@
ALLOC_OBJ_CLEAR(ks_ssl->ctx, mbedtls_ssl_context);
mbedtls_ssl_init(ks_ssl->ctx);
mbed_ok(mbedtls_ssl_setup(ks_ssl->ctx, ks_ssl->ssl_config));
+ /* We do verification in our own callback depending on the
+ exact configuration. We do not rely on the default hostname
+ verification. */
+ ASSERT(mbed_ok(mbedtls_ssl_set_hostname(ks_ssl->ctx, NULL)));
#if HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB
/* Initialize keying material exporter, new style. */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/918?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: I8bbb6ffdac7d0029dbf3c13e62c11b61813c15ef
Gerrit-Change-Number: 918
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: MaxF
Gerrit-CC: openvpn-devel
Gerrit-Attention: flichtenheld
Gerrit-MessageType: newpatchset
--+FneMv1VAA8=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: flichtenheld.
flichtenheld uploaded patch set #2 to this change.
<=
p>View Ch=
ange
Fix compatibility with mbedTLS 2.28.10+ and 3.6.3+
From rel=
ease notes:
In TLS clients, if mbedtls_ssl_set_hostname() has not been c=
alled,
mbedtls_ssl_handshake() now fails with
MBEDTLS_ERR_SSL_CERTIFI=
CATE_VERIFICATION_WITHOUT_HOSTNAME
if certificate-based authentication o=
f the server is attempted.
This is because authenticating a server witho=
ut knowing what name
to expect is usually insecure. To restore the old b=
ehavior, either
call mbedtls_ssl_set_hostname() with NULL as the hostnam=
e [...]
Change-Id: I8bbb6ffdac7d0029dbf3c13e62c11b61813c15ef
Sign=
ed-off-by: Frank Lichtenheld <frank@...2641...>
---
M src/openv=
pn/ssl_mbedtls.c
1 file changed, 4 insertions(+), 0 deletions(-)
=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/18/918/2=
diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index 92b52fe..c31079e 100644
--- a/src/openv=
pn/ssl_mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
=
@@ -1246,6 +1246,10 @@
ALLOC_OBJ_CLEAR(ks_ssl-&g=
t;ctx, mbedtls_ssl_context);
mbedtls_ssl_init(ks_ssl-&=
gt;ctx);
mbed_ok(mbedtls_ssl_setup(ks_ssl->ctx, ks_=
ssl->ssl_config));
+ /* We do verification in our own callback depending on the
=
+ exact configuration. We=
do not rely on the default hostname
+ verification. */
+ ASSERT(mbed_ok(mbedtls_ssl_set_hostname(ks_ssl->=
;ctx, NULL)));
#if HAVE_MBEDTLS_SSL_SET_=
EXPORT_KEYS_CB
/* Initialize keying material exporter,=
new style. */
To view, visit change 918. =
To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8bbb6ffdac7d0029dbf3c13e62c=
11b61813c15ef
Gerrit-Change-Number: 918
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-CC: MaxF <max@...2606...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...=
41...>
Gerrit-MessageType: newpatchset
--+FneMv1VAA8=--