Skip to contentSkip to conversation

mbedtls: don't set debug threshold if compiled without MBEDTLS_DEBUG_C

PATCH In review Steffan Karger 2 participants 2 messages Jun 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mbedtls: don't set debug threshold if compiled without MBEDTLS_DEBUG_C

For targets with space constraints, one might want to compile mbed TLS without MBEDTLS_DEBUG_C defined, to save some tens of kilobytes. Make sure OpenVPN still compiles if that is the case.

---
 src/openvpn/ssl_mbedtls.c | 2 ++
 1 file changed, 2 insertions(+)
src/openvpn/ssl_mbedtls.c +2 -0
index b5e7a6a..e20ec02 100644
@@ -777,7 +777,9 @@ void key_state_ssl_init(struct key_state_ssl *ks_ssl,
   mbedtls_ssl_config_init(&ks_ssl->ssl_config);
   mbedtls_ssl_config_defaults(&ks_ssl->ssl_config, ssl_ctx->endpoint,
       MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT);
+#ifdef MBEDTLS_DEBUG_C
   mbedtls_debug_set_threshold(3);
+#endif
   mbedtls_ssl_conf_dbg (&ks_ssl->ssl_config, my_debug, NULL);
   mbedtls_ssl_conf_rng (&ks_ssl->ssl_config, mbedtls_ctr_drbg_random,
       rand_ctx_get());
Signature · 1 line
2.7.4
#1 lore raw

ACK. An easy one for a change :-)

Your patch has been applied to the master branch.

commit b63f98633dbe2ca92cd43fc6f8597ab283a600bf

Author: Steffan Karger
Date:   Tue Jun 14 22:00:03 2016 +0200
     mbedtls: don't set debug threshold if compiled without MBEDTLS_DEBUG_C

     Signed-off-by: Steffan Karger <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/11922
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering