]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use more specific reason codes for 4-way handshake timeouts
authorJouni Malinen <jouni@codeaurora.org>
Wed, 29 Apr 2020 10:00:53 +0000 (13:00 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 29 Apr 2020 10:00:53 +0000 (13:00 +0300)
IEEE 802.11 defines reason codes for indicating 4-way handshake and
group key handshake timeouts. Use those reason codes instead of the more
generic one for these particular cases in the Authenticator state
machine.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/wpa_auth.c

index 4881357f59e0d4d9f41465c8158c50d43ab4abbd..30e725864f011837d5b004f3b1a7f2c6d7a5aea7 100644 (file)
@@ -3655,6 +3655,8 @@ SM_STEP(WPA_PTK)
                        wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_DEBUG,
                                         "PTKSTART: Retry limit %u reached",
                                         conf->wpa_pairwise_update_count);
+                       sm->disconnect_reason =
+                               WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT;
                        SM_ENTER(WPA_PTK, DISCONNECT);
                } else if (sm->TimeoutEvt)
                        SM_ENTER(WPA_PTK, PTKSTART);
@@ -3685,6 +3687,8 @@ SM_STEP(WPA_PTK)
                        wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_DEBUG,
                                         "PTKINITNEGOTIATING: Retry limit %u reached",
                                         conf->wpa_pairwise_update_count);
+                       sm->disconnect_reason =
+                               WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT;
                        SM_ENTER(WPA_PTK, DISCONNECT);
                } else if (sm->TimeoutEvt)
                        SM_ENTER(WPA_PTK, PTKINITNEGOTIATING);
@@ -3867,6 +3871,7 @@ SM_STATE(WPA_PTK_GROUP, KEYERROR)
                sm->group->GKeyDoneStations--;
        sm->GUpdateStationKeys = false;
        sm->Disconnect = true;
+       sm->disconnect_reason = WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT;
        wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_INFO,
                         "group key handshake failed (%s) after %u tries",
                         sm->wpa == WPA_VERSION_WPA ? "WPA" : "RSN",