]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Silence "Failed to read possible Application Data"
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 14 Dec 2009 14:09:20 +0000 (16:09 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 14 Dec 2009 14:09:20 +0000 (16:09 +0200)
This message from tls_connection_handshake() is not really an error in
most cases, so do not show it if there was indeed no Application Data
available (which is a normal scenario and not an indication of any
error).

src/crypto/tls_openssl.c

index 52eb4fe19553339101ef374a2d65caf2c564e4be..777405a10cd316fcf8efcaaff9e12987dabe5b36 100644 (file)
@@ -2060,9 +2060,18 @@ u8 * tls_connection_handshake(void *ssl_ctx, struct tls_connection *conn,
                if (*appl_data) {
                        res = SSL_read(conn->ssl, *appl_data, in_len);
                        if (res < 0) {
-                               tls_show_errors(MSG_INFO, __func__,
-                                               "Failed to read possible "
-                                               "Application Data");
+                               int err = SSL_get_error(conn->ssl, res);
+                               if (err == SSL_ERROR_WANT_READ ||
+                                   err == SSL_ERROR_WANT_WRITE) {
+                                       wpa_printf(MSG_DEBUG,
+                                                  "SSL: No Application Data "
+                                                  "included");
+                               } else {
+                                       tls_show_errors(MSG_INFO, __func__,
+                                                       "Failed to read "
+                                                       "possible "
+                                                       "Application Data");
+                               }
                                os_free(*appl_data);
                                *appl_data = NULL;
                        } else {