aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/wpa.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-11-30 15:22:51 (GMT)
committerJouni Malinen <j@w1.fi>2008-11-30 15:22:51 (GMT)
commita8d05fca5f14fc3b89cc408a58c47fad7470364e (patch)
tree7453dcec48deb3db75a27312a73dd4113a964449 /hostapd/wpa.c
parent0a40ec6a9059e7893970ff65554beac4782ecec4 (diff)
downloadhostap-06-a8d05fca5f14fc3b89cc408a58c47fad7470364e.zip
hostap-06-a8d05fca5f14fc3b89cc408a58c47fad7470364e.tar.gz
hostap-06-a8d05fca5f14fc3b89cc408a58c47fad7470364e.tar.bz2
Clear various flags on re-association to allow key_mgmt changes
If a STA reassociates and changes key_mgmt (e.g., from WPA-PSK to WPS), hostapd needs to reset some of the existing STA and WPA state machine variables to allow correct processing for the new association.
Diffstat (limited to 'hostapd/wpa.c')
-rw-r--r--hostapd/wpa.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hostapd/wpa.c b/hostapd/wpa.c
index b1f35ad..946552c 100644
--- a/hostapd/wpa.c
+++ b/hostapd/wpa.c
@@ -516,6 +516,18 @@ void wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth,
}
+void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm)
+{
+ /* WPA/RSN was not used - clear WPA state. This is needed if the STA
+ * reassociates back to the same AP while the previous entry for the
+ * STA has not yet been removed. */
+ if (sm == NULL)
+ return;
+
+ sm->wpa_key_mgmt = 0;
+}
+
+
static void wpa_free_sta_sm(struct wpa_state_machine *sm)
{
os_free(sm->last_rx_eapol_key);