aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-03-29 22:42:04 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-29 22:42:04 (GMT)
commit32d5295f9d2571323dcdeefc4ab7c138f0fe6e59 (patch)
treeb7f2c6af95894a3c4bdd9a0556165f4f464b6aee /src
parent358c3691cf0513a13ee906ea237297e92f915ab9 (diff)
downloadhostap-32d5295f9d2571323dcdeefc4ab7c138f0fe6e59.zip
hostap-32d5295f9d2571323dcdeefc4ab7c138f0fe6e59.tar.gz
hostap-32d5295f9d2571323dcdeefc4ab7c138f0fe6e59.tar.bz2
Add a drop_sa command to allow 802.11w testing
This drops PTK and PMK without notifying the AP.
Diffstat (limited to 'src')
-rw-r--r--src/rsn_supp/wpa.c11
-rw-r--r--src/rsn_supp/wpa.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 495e54c..a50dfd5 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -2379,3 +2379,14 @@ int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len)
return -1;
#endif /* CONFIG_NO_WPA2 */
}
+
+
+void wpa_sm_drop_sa(struct wpa_sm *sm)
+{
+ wpa_printf(MSG_DEBUG, "WPA: Clear old PMK and PTK");
+ sm->ptk_set = 0;
+ sm->tptk_set = 0;
+ os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+}
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 8db5fda..5ff6906 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -123,6 +123,7 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
const u8 *buf, size_t len);
int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
+void wpa_sm_drop_sa(struct wpa_sm *sm);
#else /* CONFIG_NO_WPA */
@@ -260,6 +261,10 @@ static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
return -1;
}
+static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
+{
+}
+
#endif /* CONFIG_NO_WPA */
#ifdef CONFIG_PEERKEY