wolfSSL: Add a debug logging callback

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
This commit is contained in:
Juliusz Sosinowicz 2021-08-26 11:25:34 +02:00 committed by Jouni Malinen
parent a5d190650b
commit 12dee16d71

View file

@ -191,6 +191,16 @@ static void remove_session_cb(WOLFSSL_CTX *ctx, WOLFSSL_SESSION *sess)
}
#ifdef DEBUG_WOLFSSL
static void wolfSSL_logging_cb(const int log_level,
const char * const log_message)
{
(void) log_level;
wpa_printf(MSG_DEBUG, "wolfSSL log:%s", log_message);
}
#endif /* DEBUG_WOLFSSL */
void * tls_init(const struct tls_config *conf)
{
WOLFSSL_CTX *ssl_ctx;
@ -198,6 +208,7 @@ void * tls_init(const struct tls_config *conf)
const char *ciphers;
#ifdef DEBUG_WOLFSSL
wolfSSL_SetLoggingCb(wolfSSL_logging_cb);
wolfSSL_Debugging_ON();
#endif /* DEBUG_WOLFSSL */