Change in openvpn[master]: Remove HAVE_EXPORT_KEYING_MATERIAL macro
A message that is not in the archive (sent off-list or not yet received): gerrit.1747937881000.Icbfffae877f8eca8d94721a4d54e140c50d4a550@...2715...
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/+/1043?usp=email
to review the following change.
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Remove HAVE_EXPORT_KEYING_MATERIAL macro
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM should be available in supported mbed TLS versions, too.
This commit includes some style changes required by uncrustify.
Change-Id: Icbfffae877f8eca8d94721a4d54e140c50d4a550
---
M config.h.cmake.in
M configure.ac
M src/openvpn/init.c
M src/openvpn/multi.c
M src/openvpn/options.c
M src/openvpn/options.h
M src/openvpn/ssl.c
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_mbedtls.h
M src/openvpn/ssl_ncp.c
10 files changed, 10 insertions(+), 67 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1043/1
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +8 -20
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -2394,9 +2392,9 @@ }#define MUST_BE_UNDEF (parm, parm_name) \ - if (options->parm != defaults.parm) { msg(M_USAGE, use_err, parm_name); } + if (options->parm != defaults.parm) { msg(M_USAGE, use_err, parm_name); }#define MUST_BE_FALSE (condition, parm_name) \ - if (condition) { msg(M_USAGE, use_err, parm_name); } + if (condition) { msg(M_USAGE, use_err, parm_name); } static void options_postprocess_verify_ce(const struct options *options,
@@ -2644,7 +2642,7 @@const char use_err[] ="--%s cannot be used with --mode server." ;#define USAGE_VALID_SERVER_PROTOS "--mode server currently only supports " \ - "--proto values of udp, tcp-server, tcp4-server, or tcp6-server" + "--proto values of udp, tcp-server, tcp4-server, or tcp6-server"#ifdef TARGET_ANDROID msg (M_FATAL ,"--mode server not supported on Android" );#endif
@@ -3594,10 +3592,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -5499,11 +5493,11 @@ }#define VERIFY_PERMISSION (mask) { \ - if (!verify_permission(p[0], file, line, (mask), permission_mask, \ - option_types_found, msglevel, options, is_inline)) \ - { \ - goto err; \ - } \ + if (!verify_permission(p[0], file, line, (mask), permission_mask, \ + option_types_found, msglevel, options, is_inline)) \ + { \ + goto err; \ + } \ } static bool
@@ -8663,13 +8657,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8686,7 +8678,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8695,7 +8686,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9452,7 +9442,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9479,7 +9468,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
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
Attention is currently required from: MaxF, flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Patchset:
PS1:
for some reason, unrelated formatting changes to some of our macros have sneaked into this patch, and upset uncrustify - these hunks can just be removed and the rest should pass fine.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 07:11:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos.
MaxF has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Quoted 1 line
for some reason, unrelated formatting changes to some of our macros have sneaked into this patch, an […]
My local uncrustify-hook didn't let me commit without making these changes. What should I do? Remove the hook and revert these changes, and commit again?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 08:18:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: MaxF, flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Quoted 1 line
My local uncrustify-hook didn't let me commit without making these changes. […]
Do not believe what uncrustify tells you, if it's not exactly version 0.72.0_f - you can change the hook to "just warn" (# exit 1 at the end of .git/hooks/pre-commit) and ignore warnings for everything that you did not touch.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 08:28:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Comment-In-Reply-To: MaxF <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: MaxF, plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
Patchset:
PS1:
So this seems to drop the support for the debian11 version of mbedtls which is 2.16.9? I'm not generally against that but I want to make sure that this is intentional? Maybe we can add a comment to that effect in the commit message?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: MaxF <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 10:00:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: MaxF, cron2, flichtenheld, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review-1 by cron2, Code-Review-1 by flichtenheld
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Remove HAVE_EXPORT_KEYING_MATERIAL macro
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM should be available in supported mbed TLS versions, too.
Change-Id: Icbfffae877f8eca8d94721a4d54e140c50d4a550
---
M config.h.cmake.in
M configure.ac
M src/openvpn/init.c
M src/openvpn/multi.c
M src/openvpn/options.c
M src/openvpn/options.h
M src/openvpn/ssl.c
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_mbedtls.h
M src/openvpn/ssl_ncp.c
10 files changed, 2 insertions(+), 59 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1043/2
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +0 -12
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -3594,10 +3592,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -8663,13 +8657,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8686,7 +8678,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8695,7 +8686,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9452,7 +9442,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9479,7 +9468,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: MaxF, cron2, flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
Quoted 1 line
So this seems to drop the support for the debian11 version of mbedtls which is 2.16. […]
I think that is okay. Debian 11 is on its to EOL and also mbed TLS on Debian 11 is a quite exotic configuration.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 10:41:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos.
MaxF has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
Quoted 1 line
I think that is okay. […]
I'm surprised that Debian 12 is failing too. It's on mbedtls 2.28, that should have one of the required functions.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 11:13:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: MaxF, cron2, plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
Quoted 1 line
I'm surprised that Debian 12 is failing too. It's on mbedtls 2. […]
Debian 12 failed in one specific t_client test, not configure. So something completely different. Likely a spurious failure. Will retry.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 2
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 12:05:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: flichtenheld <[email protected]...>
Comment-In-Reply-To: MaxF <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: MaxF, cron2, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email
to look at the new patch set (#3).
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Remove HAVE_EXPORT_KEYING_MATERIAL macro
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM is available in mbedtls versions from 2.18.0 onwards.
This commit breaks builds on Debian 11 with the stock mbed TLS package.
Change-Id: Icbfffae877f8eca8d94721a4d54e140c50d4a550
---
M config.h.cmake.in
M configure.ac
M src/openvpn/init.c
M src/openvpn/multi.c
M src/openvpn/options.c
M src/openvpn/options.h
M src/openvpn/ssl.c
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_mbedtls.h
M src/openvpn/ssl_ncp.c
10 files changed, 2 insertions(+), 59 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1043/3
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +0 -12
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -3594,10 +3592,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -8663,13 +8657,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8686,7 +8678,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8695,7 +8686,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9452,7 +9442,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9479,7 +9468,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 3
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: MaxF, cron2, plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Patch Set 3: Code-Review+2
(1 comment)
Patchset:
PS1:
Quoted 1 line
Debian 12 failed in one specific
t_clienttest, not configure. So something completely different. […]
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 3
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[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: cron2 <[email protected]...>
Gerrit-Attention: MaxF <[email protected]...>
Gerrit-Comment-Date: Tue, 27 May 2025 15:51:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: flichtenheld <[email protected]...>
Comment-In-Reply-To: MaxF <[email protected]...>
Gerrit-MessageType: comment
PATCH v3 1/1 Remove HAVE_EXPORT_KEYING_MATERIAL macro
In reply to a message not in the archiveFrom: Max Fillinger <[email protected]...>
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM is available in mbedtls versions from 2.18.0 onwards.
This commit breaks builds on Debian 11 with the stock mbed TLS package.
---
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/+/1043
This mail reflects revision 3 of this Change.
Signed-off-by line for the author was added as per our policy.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +0 -12
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -3594,10 +3592,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -8663,13 +8657,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8686,7 +8678,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8695,7 +8686,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9452,7 +9442,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9479,7 +9468,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
[Openvpn-devel] [PATCH applied] Re: Remove HAVE_EXPORT_KEYING_MATERIAL macro
"because it makes sense" - BB and GHA say that this build fine on everything *but* Debian 11 with the stock mbedTLS package - and we made a conscious decision to accept that fallout. *If* someone needs this particular combination (openvpn 2.7 and mbedtls on debian 11), they need to build a newer mbedTLS version from source.
Less #ifdef really help make our code better.
The patch itself is fairly trivial (v2 had "fight with uncrustify" fallout), removing the logic from cmake and autoconf, and removing #ifdefs galore.
Your patch has been applied to the master branch.
commit baa5b70d4150717ab35ef341198189918362066b
Author: Max Fillinger Date: Tue May 27 18:03:50 2025 +0200
Remove HAVE_EXPORT_KEYING_MATERIAL macro
Signed-off-by: MaxF <[email protected]...>
Acked-by: Frank Lichtenheld <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31799.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#4) to the change originally created by MaxF. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Remove HAVE_EXPORT_KEYING_MATERIAL macro
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM is available in mbedtls versions from 2.18.0 onwards.
This commit breaks builds on Debian 11 with the stock mbed TLS package.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31799.html
---
M config.h.cmake.in
M configure.ac
M src/openvpn/init.c
M src/openvpn/multi.c
M src/openvpn/options.c
M src/openvpn/options.h
M src/openvpn/ssl.c
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_mbedtls.h
M src/openvpn/ssl_ncp.c
10 files changed, 2 insertions(+), 59 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1043/4
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +0 -12
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -3595,10 +3593,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -8664,13 +8658,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8687,7 +8679,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8696,7 +8687,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9453,7 +9443,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9480,7 +9469,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 4
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1043?usp=email )
Change subject: Remove HAVE_EXPORT_KEYING_MATERIAL macro
......................................................................
Remove HAVE_EXPORT_KEYING_MATERIAL macro
This was always defined in all supported versions of OpenSSL and WolfSSL. EKM is available in mbedtls versions from 2.18.0 onwards.
This commit breaks builds on Debian 11 with the stock mbed TLS package.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31799.html
---
M config.h.cmake.in
M configure.ac
M src/openvpn/init.c
M src/openvpn/multi.c
M src/openvpn/options.c
M src/openvpn/options.h
M src/openvpn/ssl.c
M src/openvpn/ssl_mbedtls.c
M src/openvpn/ssl_mbedtls.h
M src/openvpn/ssl_ncp.c
10 files changed, 2 insertions(+), 59 deletions(-)
config.h.cmake.in +0 -3
@@ -120,9 +120,6 @@ /* Define to 1 if you have the <err.h> header file. */ #cmakedefine HAVE_ERR_H -/* Crypto library supports keying material exporter */ -#define HAVE_EXPORT_KEYING_MATERIAL 1 - /* Define to 1 if you have the <fcntl.h> header file. */ #cmakedefine HAVE_FCNTL_H
configure.ac +1 -17
@@ -988,10 +988,6 @@ [AC_MSG_ERROR([OpenSSL check for AES-256-GCM support failed])] ) - # All supported OpenSSL versions (>= 1.1.0) - # have this feature - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1064,7 +1060,6 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_TLS_PRF], [0], [no])] ) - have_export_keying_material="yes" AC_CHECK_FUNC( [mbedtls_ssl_conf_export_keys_ext_cb], [AC_DEFINE([HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB], [1], [yes])],
@@ -1077,7 +1072,7 @@ [AC_DEFINE([HAVE_MBEDTLS_SSL_SET_EXPORT_KEYS_CB], [0], [no])] ) if test "x$ac_cv_func_mbedtls_ssl_set_export_keys_cb" != xyes; then - have_export_keying_material="no" + AC_MSG_ERROR(This version of mbed TLS has no support for exporting key material.) fi fi
@@ -1132,17 +1127,12 @@ ) AC_CHECK_HEADER([wolfssl/options.h],,[AC_MSG_ERROR([wolfSSL header wolfssl/options.h not found!])]) - # wolfSSL signal EKM support - have_export_keying_material="yes" - if test "${enable_wolfssl_options_h}" = "yes"; then AC_DEFINE([EXTERNAL_OPTS_OPENVPN], [1], [Include options.h from wolfSSL library]) else AC_DEFINE([WOLFSSL_USER_SETTINGS], [1], [Use custom user_settings.h file for wolfSSL library]) fi - have_export_keying_material="yes" - CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}"
@@ -1346,12 +1336,6 @@ test "${enable_dns_updown_by_default}" = "yes" && AC_DEFINE([ENABLE_DNS_UPDOWN_BY_DEFAULT], [1], [Enable dns-updown hook by default]) test "${enable_ntlm}" = "yes" && AC_DEFINE([ENABLE_NTLM], [1], [Enable NTLMv2 proxy support]) test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes]) -if test "${have_export_keying_material}" = "yes"; then - AC_DEFINE( - [HAVE_EXPORT_KEYING_MATERIAL], [1], - [Crypto library supports keying material exporter] - ) -fi OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}" OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
src/openvpn/init.c +0 -2
@@ -3483,7 +3483,6 @@ to.comp_options = options->comp;#endif -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (options->keying_material_exporter_label) { to.ekm_size = options->keying_material_exporter_length;
@@ -3499,7 +3498,6 @@ { to.ekm_size =0 ; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ /* TLS handshake authentication (--tls-auth) */ if (options->ce.tls_auth_file)
src/openvpn/multi.c +0 -2
@@ -1837,7 +1837,6 @@ c->c2.push_request_received = true; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (proto &IV_PROTO_TLS_KEY_EXPORT ) { o->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -1856,7 +1855,6 @@ { o->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif if (proto &IV_PROTO_CC_EXIT_NOTIFY ) {
src/openvpn/options.c +0 -12
@@ -664,10 +664,8 @@#endif "--x509-track x : Save peer X509 attribute x in environment for use by\n" " plugins and management interface.\n" -#ifdef HAVE_EXPORT_KEYING_MATERIAL"--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n" " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n" -#endif"--remote-cert-ku v ... : Require that the peer certificate was signed with\n" " explicit key usage, you can specify more than one value.\n" " value should be given in hex format.\n"
@@ -3595,10 +3593,6 @@"calculation anymore or your security policy (e.g. FIPS 140-2) " "forbids it. Connections will only work with peers running " "OpenVPN 2.6.0 or higher)"); -#ifndef HAVE_EXPORT_KEYING_MATERIAL -msg (M_FATAL ,"Keying Material Exporters (RFC 5705) not available either. " -"No way to generate data channel keys left." ); -#endif if (o->mode ==MODE_SERVER ) { msg(M_WARN, "Automatically enabling option "
@@ -8664,13 +8658,11 @@/* NCP only option that is pushed by the server to enable EKM, * should not be used by normal users in config files*/ VERIFY_PERMISSION (OPT_P_NCP) -#ifdef HAVE_EXPORT_KEYING_MATERIAL if (streq(p[1], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ; } else -#endif {msg (msglevel,"Unknown key-derivation method %s" , p[1 ]); }
@@ -8687,7 +8679,6 @@ { options->imported_protocol_flags |=CO_USE_CC_EXIT_NOTIFY ; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq(p[j], "tls-ekm")) { options->imported_protocol_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -8696,7 +8687,6 @@ { options->imported_protocol_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif else if (streq(p[j], "aead-epoch")) { options->imported_protocol_flags |=CO_EPOCH_DATA_KEY_FORMAT ;
@@ -9453,7 +9443,6 @@ options->use_peer_id = true; options->peer_id =atoi_warn (p[1 ], msglevel); } -#ifdef HAVE_EXPORT_KEYING_MATERIAL else if (streq (p[0 ],"keying-material-exporter" ) && p[1 ] && p[2 ]) {int ekm_length =positive_atoi (p[2 ], msglevel);
@@ -9480,7 +9469,6 @@ options->keying_material_exporter_label = p[1 ]; options->keying_material_exporter_length = ekm_length; } -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ else if (streq (p[0 ],"allow-recursive-routing" ) && !p[1 ]) {VERIFY_PERMISSION (OPT_P_GENERAL );
src/openvpn/options.h +0 -2
@@ -701,11 +701,9 @@bool use_peer_id;uint32_t peer_id; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /* Keying Material Exporters [RFC 5705] */ const char *keying_material_exporter_label;int keying_material_exporter_length; -#endif /* force using TLS key material export for data channel key generation */ bool force_key_material_export;
src/openvpn/ssl.c +0 -2
@@ -2034,10 +2034,8 @@buf_printf (&out,"IV_CIPHERS=%s\n" , session->opt->config_ncp_ciphers); -#ifdef HAVE_EXPORT_KEYING_MATERIAL iv_proto |=IV_PROTO_TLS_KEY_EXPORT ; iv_proto |=IV_PROTO_DYN_TLS_CRYPT ; -#endif buf_printf (&out,"IV_PROTO=%d\n" , iv_proto);
src/openvpn/ssl_mbedtls.c +1 -13
@@ -174,8 +174,6 @@return ctx->initialised; } -#ifdef HAVE_EXPORT_KEYING_MATERIAL -#if HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB /* * Key export callback for older versions of mbed TLS, to be used with
@@ -254,7 +252,7 @@ cache->tls_prf_type = 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 defined +#error either mbedtls_ssl_conf_export_keys_ext_cb or mbedtls_ssl_set_export_keys_cb must be available in mbed TLS#endif /* HAVE_MBEDTLS_SSL_CONF_EXPORT_KEYS_EXT_CB */ bool
@@ -289,16 +287,6 @@return false; } } -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -bool -key_state_export_keying_material (struct tls_session *session, -const char *label,size_t label_size, -void *ekm,size_t ekm_size) -{ -/* Dummy function to avoid ifdefs in the common code */ -return false; -} -#endif /* HAVE_EXPORT_KEYING_MATERIAL */ bool tls_ctx_set_options (struct tls_root_ctx *ctx,unsigned int ssl_flags)
src/openvpn/ssl_mbedtls.h +0 -4
@@ -85,7 +85,6 @@void *sign_ctx; }; -#ifdef HAVE_EXPORT_KEYING_MATERIAL /** struct to cache TLS secrets for keying material exporter (RFC 5705). * The constants (64 and 48) are inherent to TLS version and * the whole keying material export will likely change when they change */
@@ -94,9 +93,6 @@mbedtls_tls_prf_types tls_prf_type;unsigned char master_secret[48 ]; }; -#else /* ifdef HAVE_EXPORT_KEYING_MATERIAL */ -struct tls_key_cache { }; -#endif /** * Structure that wraps the TLS context. Contents differ depending on the
src/openvpn/ssl_ncp.c +0 -2
@@ -446,7 +446,6 @@ session->opt->crypto_flags &= ~CO_EPOCH_DATA_KEY_FORMAT ; } -#if defined(HAVE_EXPORT_KEYING_MATERIAL )if (iv_proto_peer &IV_PROTO_TLS_KEY_EXPORT ) { session->opt->crypto_flags |=CO_USE_TLS_KEY_MATERIAL_EXPORT ;
@@ -479,7 +478,6 @@ { session->opt->crypto_flags |=CO_USE_DYNAMIC_TLS_CRYPT ; } -#endif /* if defined(HAVE_EXPORT_KEYING_MATERIAL) */ }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1043?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: Icbfffae877f8eca8d94721a4d54e140c50d4a550
Gerrit-Change-Number: 1043
Gerrit-PatchSet: 4
Gerrit-Owner: MaxF <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged