aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/wpa.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-08-31 08:04:47 (GMT)
committerJouni Malinen <j@w1.fi>2008-08-31 08:04:47 (GMT)
commit5d22a1d5aaa7bafdbb3180c3cfec4868b347a86a (patch)
tree7b32a6411c0176f141c45d922004b9d9236184af /hostapd/wpa.c
parent1e858f69d9c4386467e57452c3ada245a00fd172 (diff)
downloadhostap-06-5d22a1d5aaa7bafdbb3180c3cfec4868b347a86a.zip
hostap-06-5d22a1d5aaa7bafdbb3180c3cfec4868b347a86a.tar.gz
hostap-06-5d22a1d5aaa7bafdbb3180c3cfec4868b347a86a.tar.bz2
IEEE 802.11w: Added association ping
This updates management frame protection to use the assocition ping process from the latest draft (D6.0) to protect against unauthenticated authenticate or (re)associate frames dropping association.
Diffstat (limited to 'hostapd/wpa.c')
-rw-r--r--hostapd/wpa.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/hostapd/wpa.c b/hostapd/wpa.c
index 4502808..a922ae5 100644
--- a/hostapd/wpa.c
+++ b/hostapd/wpa.c
@@ -1081,6 +1081,8 @@ void wpa_remove_ptk(struct wpa_state_machine *sm)
void wpa_auth_sm_event(struct wpa_state_machine *sm, wpa_event event)
{
+ int remove_ptk = 1;
+
if (sm == NULL)
return;
@@ -1113,11 +1115,18 @@ void wpa_auth_sm_event(struct wpa_state_machine *sm, wpa_event event)
sm->ft_completed = 0;
#endif /* CONFIG_IEEE80211R */
- sm->PTK_valid = FALSE;
- os_memset(&sm->PTK, 0, sizeof(sm->PTK));
+#ifdef CONFIG_IEEE80211W
+ if (sm->mgmt_frame_prot && event == WPA_AUTH)
+ remove_ptk = 0;
+#endif /* CONFIG_IEEE80211W */
+
+ if (remove_ptk) {
+ sm->PTK_valid = FALSE;
+ os_memset(&sm->PTK, 0, sizeof(sm->PTK));
- if (event != WPA_REAUTH_EAPOL)
- wpa_remove_ptk(sm);
+ if (event != WPA_REAUTH_EAPOL)
+ wpa_remove_ptk(sm);
+ }
wpa_sm_step(sm);
}