Don't store debug func ptr cb + ctx in SSL config if !DEBUG_C
Note: This is an structure-API breaking change that we might
not be able to upstream.
diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h
index ad60e82..3e8c9be 100644
--- a/include/mbedtls/ssl.h
+++ b/include/mbedtls/ssl.h
@@ -898,9 +898,11 @@
const int *ciphersuite_list[4]; /*!< allowed ciphersuites per version */
+#if defined(MBEDTLS_DEBUG_C)
/** Callback for printing debug output */
void (*f_dbg)(void *, int, const char *, int, const char *);
void *p_dbg; /*!< context for the debug function */
+#endif /* MBEDTLS_DEBUG_C */
#if !defined(MBEDTLS_SSL_CONF_RNG)
/** Callback for getting (pseudo-)random numbers */
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 84c78c4..650dec7 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -8217,8 +8217,14 @@
void (*f_dbg)(void *, int, const char *, int, const char *),
void *p_dbg )
{
+#if defined(MBEDTLS_DEBUG_C)
conf->f_dbg = f_dbg;
conf->p_dbg = p_dbg;
+#else
+ ((void) conf);
+ ((void) f_dbg);
+ ((void) p_dbg);
+#endif /* MBEDTLS_DEBUG_C */
}
#if !defined(MBEDTLS_SSL_CONF_RECV) && \