]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
mbedtls: Allow TLS 1.3 if available
authorMax Fillinger <maximilian.fillinger@foxcrypto.com>
Tue, 3 Jun 2025 14:06:24 +0000 (16:06 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 3 Jun 2025 14:15:06 +0000 (16:15 +0200)
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 <maximilian.fillinger@foxcrypto.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20250603140631.11696-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31858.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
README.mbedtls
src/openvpn/ssl_mbedtls.c

index c4f3924bd549ed8c4a8ca80cfcc411bfc3cfdc47..a1012e97bf9a4fe8cc1dd059a815d3daac1319fe 100644 (file)
@@ -26,5 +26,9 @@ Plugin/Script features:
 
 *************************************************************************
 
-Mbed TLS 3 has implemented (parts of) the TLS 1.3 protocol, but we have disabled
-support in OpenVPN because the TLS-Exporter function is not yet implemented.
+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.
index 7452c300d8990dbe1c54eeb671ddb8738694f662..ecccc260ae4e07f767fa997d4cc04ac2c3017d29 100644 (file)
@@ -1048,11 +1048,14 @@ tls_ctx_personalise_random(struct tls_root_ctx *ctx)
 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_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 compiled without support for TLS 1.2 or 1.3
+#endif
 }
 
 /**