]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Add more precise logging in wolfssl_handshake()
authorJuliusz Sosinowicz <juliusz@wolfssl.com>
Wed, 8 Mar 2023 17:18:40 +0000 (18:18 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 4 Nov 2023 16:18:25 +0000 (18:18 +0200)
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
src/crypto/tls_wolfssl.c

index d798f8878ec422466c0d990adc5594660579a735..0b2947daf9b7ec150b1b54a3d5875eb9adbe739e 100644 (file)
@@ -1670,20 +1670,31 @@ static struct wpabuf * wolfssl_handshake(struct tls_connection *conn,
                wpa_printf(MSG_DEBUG, "SSL: wolfSSL_connect: %d", res);
        }
 
-       if (res != 1) {
+       if (res != WOLFSSL_SUCCESS) {
                int err = wolfSSL_get_error(conn->ssl, res);
 
-               if (err == SSL_ERROR_WANT_READ) {
+               if (err == WOLFSSL_ERROR_NONE) {
                        wpa_printf(MSG_DEBUG,
-                                  "SSL: wolfSSL_connect - want more data");
-               } else if (err == SSL_ERROR_WANT_WRITE) {
+                                  "SSL: %s - WOLFSSL_ERROR_NONE (%d)",
+                                  server ? "wolfSSL_accept" :
+                                  "wolfSSL_connect", res);
+               } else if (err == WOLFSSL_ERROR_WANT_READ) {
                        wpa_printf(MSG_DEBUG,
-                                  "SSL: wolfSSL_connect - want to write");
+                                  "SSL: %s - want more data",
+                                  server ? "wolfSSL_accept" :
+                                  "wolfSSL_connect");
+               } else if (err == WOLFSSL_ERROR_WANT_WRITE) {
+                       wpa_printf(MSG_DEBUG,
+                                  "SSL: %s - want to write",
+                                  server ? "wolfSSL_accept" :
+                                  "wolfSSL_connect");
                } else {
                        char msg[80];
 
                        wpa_printf(MSG_DEBUG,
-                                  "SSL: wolfSSL_connect - failed %s",
+                                  "SSL: %s - failed %s",
+                                  server ? "wolfSSL_accept" :
+                                  "wolfSSL_connect",
                                   wolfSSL_ERR_error_string(err, msg));
                        conn->failed++;
                }