aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-10-14 10:41:08 (GMT)
committerJouni Malinen <j@w1.fi>2017-10-16 14:43:10 (GMT)
commit16579769ff7bb255e101c6b77fb2c47d3735a883 (patch)
tree53d796d142b46a66182f10e9120a14c798d54600 /wpa_supplicant/events.c
parentb74f82a4f88107756f2320e9435a61cb165a569a (diff)
downloadhostap-16579769ff7bb255e101c6b77fb2c47d3735a883.zip
hostap-16579769ff7bb255e101c6b77fb2c47d3735a883.tar.gz
hostap-16579769ff7bb255e101c6b77fb2c47d3735a883.tar.bz2
Add testing functionality for resetting PN/IPN for configured keys
This can be used to test replay protection. The "RESET_PN" command in wpa_supplicant and "RESET_PN <addr>" command in hostapd resets the local counters to zero for the last configured key. For hostapd, the address parameter specifies which STA this operation is for or selects GTK ("ff:ff:ff:ff:ff:ff") or IGTK ("ff:ff:ff:ff:ff:ff IGTK"). This functionality is for testing purposes and included only in builds with CONFIG_TESTING_OPTIONS=y. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0667862..6e4a9f6 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -314,6 +314,11 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)
wpas_rrm_reset(wpa_s);
wpa_s->wnmsleep_used = 0;
+
+#ifdef CONFIG_TESTING_OPTIONS
+ wpa_s->last_tk_alg = WPA_ALG_NONE;
+ os_memset(wpa_s->last_tk, 0, sizeof(wpa_s->last_tk));
+#endif /* CONFIG_TESTING_OPTIONS */
}