]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Add a debug logging callback
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Thu, 26 Aug 2021 09:25:34 +0000 (11:25 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 17 Apr 2022 19:02:55 +0000 (22:02 +0300)
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/tls_wolfssl.c

index 234ebac86cef77b99cfe6151529d4eeb4e998e22..0d4cd8f7fc82611cac3714e76b18a002f9eadec5 100644 (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 */