From: "cron2 (Code Review)" Date: Fri, 25 Apr 2025 13:22:07 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="khuNkDROUa4="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix mbed TLS key exporter functionality in 3.6.x and cmake List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel , MaxF --khuNkDROUa4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/920?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Fix mbed TLS key exporter functionality in 3.6.x and cmake ...................................................................... Fix mbed TLS key exporter functionality in 3.6.x and cmake Cmake did not check for the mbedtls_ssl_set_export_keys_cb symbol when generating an mbed TLS configuration. This causes no actual working key exporter to be in the binary. Also add an explicit #error to catch this situation during compilation. Change-Id: If38e80e268dc0ee7e57de2c175c5b4db0ce55ed0 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20250425131002.21772-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 510.html Signed-off-by: Gert Doering --- M CMakeLists.txt M src/openvpn/ssl_mbedtls.c 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/20/920/4 diff --git a/CMakeLists.txt b/CMakeLists.txt index b04adce..a8fb64b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,7 @@ set(CMAKE_REQUIRED_LIBRARIES "mbedtls;mbedx509;mbedcrypto") check_symbol_exists(mbedtls_ctr_drbg_update_ret mbedtls/ctr_drbg.h HAV= E_MBEDTLS_CTR_DRBG_UPDATE_RET) check_symbol_exists(mbedtls_ssl_conf_export_keys_ext_cb mbedtls/ssl.h = HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB) + check_symbol_exists(mbedtls_ssl_set_export_keys_cb mbedtls/ssl.h HAVE_= MBEDTLS_SSL_SET_EXPORT_KEYS_CB) check_include_files(psa/crypto.h HAVE_MBEDTLS_PSA_CRYPTO_H) endfunction() diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c index e15c391..ec3135a 100644 --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c @@ -253,6 +253,8 @@ memcpy(cache->master_secret, secret, sizeof(cache->master_secret)); cache->tls_prf_type =3D tls_prf_type; } +#else /* if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ +#error either HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB or HAVE_MBEDTLS_SSL= _SET_EXPORT_KEYS_CB must be defined when HAVE_EXPORT_KEYING_MATERIAL is def= ined #endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/920?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: If38e80e268dc0ee7e57de2c175c5b4db0ce55ed0 Gerrit-Change-Number: 920 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: MaxF Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --khuNkDROUa4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by plaisthos.

View Change

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

Fix mbed TLS key exporter functionality in 3.=
6.x and cmake

Cmake did not check for the mbedtls_ssl_set_export_key= s_cb symbol
when generating an mbed TLS configuration. This causes no ac= tual
working key exporter to be in the binary.

Also add an explic= it #error to catch this situation during compilation.

Change-Id: If3= 8e80e268dc0ee7e57de2c175c5b4db0ce55ed0
Signed-off-by: Arne Schwabe <a= rne@...1227...>
Acked-by: Frank Lichtenheld <frank@...2641...><= br>Message-Id: <20250425131002.21772-1-gert@...1296...>
URL: https= ://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31510.htmlSigned-off-by: Gert Doering <gert@...1296...>
---
M CMakeList= s.txt
M src/openvpn/ssl_mbedtls.c
2 files changed, 3 insertions(+), 0= deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn ref=
s/changes/20/920/4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b04adce..a8fb64b 100644
--- a/CMakeLists= .txt
+++ b/CMakeLists.txt
@@ -275,6 +275,7 = @@
set(CMAKE_REQUIRED_LIBRARIES "mbedtls;mbedx509= ;mbedcrypto")
check_symbol_exists(mbedtls_ctr_drb= g_update_ret mbedtls/ctr_drbg.h HAVE_MBEDTLS_CTR_DRBG_UPDATE_RET) check_symbol_exists(mbedtls_ssl_conf_export_keys_ext_cb mbedtls= /ssl.h HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB)
+ check_symbol_exists(mbedtls_ssl_set_export= _keys_cb mbedtls/ssl.h HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB)
check_include_files(psa/crypto.h HAVE_MBEDTLS_PSA_CRYPTO_H)
endfunction()

diff --git a/src/op= envpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index e15c3= 91..ec3135a 100644
--- a/src/openvpn/ssl_mbedtls.c+++ b/src/openvpn/ssl_mbedtls.c
@@ -253,6 +253,8 @@=
memcpy(cache->master_secret, secret, sizeof(cache-= >master_secret));
cache->tls_prf_type =3D tls_pr= f_type;
}
+#else /* if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */
<= span style=3D"color: hsl(120, 100%, 40%);">+#error either HAVE_MBEDTLS_SSL_= CONF_EXPORT_KEYS_EXT_CB or HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB must be defi= ned when HAVE_EXPORT_KEYING_MATERIAL is defined
#endif /* = HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */

bool

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If38e80e268dc0ee7e57de2c175c= 5b4db0ce55ed0
Gerrit-Change-Number: 920
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: MaxF <max@...2606...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--khuNkDROUa4=--