[Openvpn-devel,v2] Unbreak Mbed TLS 4 build

Message ID 20260217171306.31229-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v2] Unbreak Mbed TLS 4 build | expand

Commit Message

Gert Doering Feb. 17, 2026, 5:13 p.m. UTC
From: Max Fillinger <maximilian.fillinger@sentyron.com>

The previous Mbed TLS 4 change removed the mbedtls/version.h include
from syshead.h. But this include in mbedtls_compat.h where it's needed.

Also fix a warning by removing a size_t < 0 comparison.

Change-Id: Ia5d330fe5c922aaa6948c1fb05c9a4947c833311
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1538
---

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/+/1538
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>

Comments

Gert Doering Feb. 17, 2026, 9:28 p.m. UTC | #1
Thanks.  Indeed, as confirmed by GHA, this un-breaks things :-)

Your patch has been applied to the master branch.

commit cb7446c23927c1d61c2694152b3e01e81d517e37
Author: Max Fillinger
Date:   Tue Feb 17 18:13:00 2026 +0100

     Unbreak Mbed TLS 4 build

     Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1538
     Message-Id: <20260217171306.31229-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35701.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/crypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c
index cba6bb5..e8931d7 100644
--- a/src/openvpn/crypto_mbedtls.c
+++ b/src/openvpn/crypto_mbedtls.c
@@ -700,7 +700,7 @@ 
 md_full(const char *mdname, const uint8_t *src, size_t src_len, uint8_t *dst)
 {
     const md_info_t *md = md_get(mdname);
-    if (md == NULL || src_len < 0)
+    if (md == NULL)
     {
         return false;
     }
diff --git a/src/openvpn/mbedtls_compat.h b/src/openvpn/mbedtls_compat.h
index 667529e..50739b6 100644
--- a/src/openvpn/mbedtls_compat.h
+++ b/src/openvpn/mbedtls_compat.h
@@ -36,6 +36,7 @@ 
 
 #include <mbedtls/asn1.h>
 #include <mbedtls/pk.h>
+#include <mbedtls/version.h>
 
 #if MBEDTLS_VERSION_NUMBER < 0x04000000
 #include <mbedtls/ctr_drbg.h>