Change SSL debug API in the library
diff --git a/include/mbedtls/compat-1.3.h b/include/mbedtls/compat-1.3.h
index 8c267dc..7d68564 100644
--- a/include/mbedtls/compat-1.3.h
+++ b/include/mbedtls/compat-1.3.h
@@ -120,9 +120,6 @@
#if defined MBEDTLS_DEBUG_C
#define POLARSSL_DEBUG_C MBEDTLS_DEBUG_C
#endif
-#if defined MBEDTLS_DEBUG_DFL_MODE
-#define POLARSSL_DEBUG_DFL_MODE MBEDTLS_DEBUG_DFL_MODE
-#endif
#if defined MBEDTLS_DEPRECATED_REMOVED
#define POLARSSL_DEPRECATED_REMOVED MBEDTLS_DEPRECATED_REMOVED
#endif
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index d2074df..685baf2 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -2413,9 +2413,6 @@
*/
//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
-/* Debug options */
-//#define MBEDTLS_DEBUG_DFL_MODE MBEDTLS_DEBUG_LOG_FULL /**< Default log: Full or Raw */
-
/* X509 options */
//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
diff --git a/include/mbedtls/debug.h b/include/mbedtls/debug.h
index 99ea111..618a68c 100644
--- a/include/mbedtls/debug.h
+++ b/include/mbedtls/debug.h
@@ -38,24 +38,6 @@
#if defined(MBEDTLS_DEBUG_C)
-#define MBEDTLS_DEBUG_LOG_FULL 0 /**< Include file:line in log lines */
-#define MBEDTLS_DEBUG_LOG_RAW 1 /**< Only log raw debug lines */
-
-/**
- * \name SECTION: Module settings
- *
- * The configuration options you can set for this module are in this section.
- * Either change them in config.h or define them on the compiler command line.
- * \{
- */
-
-#if !defined(MBEDTLS_DEBUG_DFL_MODE)
-#define MBEDTLS_DEBUG_DFL_MODE MBEDTLS_DEBUG_LOG_FULL /**< Default log: Full or Raw */
-#endif
-
-/* \} name SECTION: Module settings */
-
-
#define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
mbedtls_debug_print_msg_free( ssl, level, __FILE__, __LINE__, mbedtls_debug_fmt args )
@@ -96,15 +78,6 @@
#endif
/**
- * \brief Set the log mode for the debug functions globally
- * (Default value: MBEDTLS_DEBUG_DFL_MODE)
- *
- * \param log_mode The log mode to use (MBEDTLS_DEBUG_LOG_FULL or
- * MBEDTLS_DEBUG_LOG_RAW)
- */
-void mbedtls_debug_set_log_mode( int log_mode );
-
-/**
* \brief Set the level threshold to handle globally. Messages that have a
* level over the threshold value are ignored.
* (Default value: 0 (No debug))
diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h
index 5a3de90..d75e93a 100644
--- a/include/mbedtls/ssl.h
+++ b/include/mbedtls/ssl.h
@@ -488,7 +488,7 @@
const int *ciphersuite_list[4]; /*!< allowed ciphersuites per version */
/** Callback for printing debug output */
- void (*f_dbg)(void *, int, const char *);
+ void (*f_dbg)(void *, int, const char *, int, const char *);
void *p_dbg; /*!< context for the debug function */
/** Callback for getting (pseudo-)random numbers */
@@ -957,12 +957,19 @@
/**
* \brief Set the debug callback
*
+ * The callback has the following argument:
+ * void * opaque context for the callback
+ * int debug level
+ * const char * file name
+ * int line number
+ * const char * message
+ *
* \param conf SSL configuration
* \param f_dbg debug function
* \param p_dbg debug parameter
*/
void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf,
- void (*f_dbg)(void *, int, const char *),
+ void (*f_dbg)(void *, int, const char *, int, const char *),
void *p_dbg );
/**