From: Jouni Malinen Date: Sat, 5 Sep 2015 15:33:35 +0000 (+0300) Subject: Indicate CTRL-EVENT-AUTH-REJECT event on authentication rejection X-Git-Tag: hostap_2_5~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec4387f9c92a66e921ee8b71d10807cb36b99697;p=thirdparty%2Fhostap.git Indicate CTRL-EVENT-AUTH-REJECT event on authentication rejection This allows control interface monitors to get more detailed information in cases where wpa_supplicant-based SME receives an Authentication frame with non-zero status code. Signed-off-by: Jouni Malinen --- diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 8738031ce..3de468235 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -28,6 +28,8 @@ extern "C" { #define WPA_EVENT_DISCONNECTED "CTRL-EVENT-DISCONNECTED " /** Association rejected during connection attempt */ #define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT " +/** Authentication rejected during connection attempt */ +#define WPA_EVENT_AUTH_REJECT "CTRL-EVENT-AUTH-REJECT " /** wpa_supplicant is exiting */ #define WPA_EVENT_TERMINATING "CTRL-EVENT-TERMINATING " /** Password change was completed successfully */ diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 54bb6c948..f2e5a43b9 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -817,8 +817,22 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data) #endif /* CONFIG_SAE */ if (data->auth.status_code != WLAN_STATUS_SUCCESS) { - wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication failed (status " - "code %d)", data->auth.status_code); + char *ie_txt = NULL; + + if (data->auth.ies && data->auth.ies_len) { + size_t buflen = 2 * data->auth.ies_len + 1; + ie_txt = os_malloc(buflen); + if (ie_txt) { + wpa_snprintf_hex(ie_txt, buflen, data->auth.ies, + data->auth.ies_len); + } + } + wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_AUTH_REJECT MACSTR + " auth_type=%u auth_transaction=%u status_code=%u ie=%s", + MAC2STR(data->auth.peer), data->auth.auth_type, + data->auth.auth_transaction, data->auth.status_code, + ie_txt); + os_free(ie_txt); if (data->auth.status_code != WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG ||