Use more specific reason codes for 4-way handshake timeouts

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>
This commit is contained in:
Jouni Malinen 2020-04-29 13:00:53 +03:00 committed by Jouni Malinen
parent 83c9b69b01
commit a803ba4f9d

View file

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