From: Juliusz Sosinowicz Date: Thu, 26 Aug 2021 09:25:34 +0000 (+0200) Subject: wolfSSL: Add a debug logging callback X-Git-Tag: hostap_2_11~2034 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12dee16d71938e3912cad0dd2ab532ee4d2deb20;p=thirdparty%2Fhostap.git wolfSSL: Add a debug logging callback Signed-off-by: Juliusz Sosinowicz --- diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c index 234ebac86..0d4cd8f7f 100644 --- a/src/crypto/tls_wolfssl.c +++ b/src/crypto/tls_wolfssl.c @@ -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 */