aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-10-14 15:05:52 (GMT)
committerJouni Malinen <j@w1.fi>2017-10-16 14:48:25 (GMT)
commit3bcc52473328c88677b7c07e0bdd8e685c262c12 (patch)
tree91a06b4e97e08f8022ff8c5fd401cd92f40e1fd2
parentdaa40960844e7b9557a152869f06bb08f150cd2a (diff)
downloadhostap-3bcc52473328c88677b7c07e0bdd8e685c262c12.zip
hostap-3bcc52473328c88677b7c07e0bdd8e685c262c12.tar.gz
hostap-3bcc52473328c88677b7c07e0bdd8e685c262c12.tar.bz2
tests: WPA2-PSK AP and PTK rekey enforced by station and ANonce change
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_ap_psk.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py
index 2c753af..551baf7 100644
--- a/tests/hwsim/test_ap_psk.py
+++ b/tests/hwsim/test_ap_psk.py
@@ -118,6 +118,25 @@ def test_ap_wpa2_ptk_rekey(dev, apdev):
raise Exception("PTK rekey timed out")
hwsim_utils.test_connectivity(dev[0], hapd)
+def test_ap_wpa2_ptk_rekey_anonce(dev, apdev):
+ """WPA2-PSK AP and PTK rekey enforced by station and ANonce change"""
+ ssid = "test-wpa2-psk"
+ passphrase = 'qwertyuiop'
+ params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+ hapd = hostapd.add_ap(apdev[0], params)
+ dev[0].connect(ssid, psk=passphrase, wpa_ptk_rekey="1", scan_freq="2412")
+ dev[0].dump_monitor()
+ anonce1 = dev[0].request("GET anonce")
+ if "OK" not in dev[0].request("KEY_REQUEST 0 1"):
+ raise Exception("KEY_REQUEST failed")
+ ev = dev[0].wait_event(["WPA: Key negotiation completed"])
+ if ev is None:
+ raise Exception("PTK rekey timed out")
+ anonce2 = dev[0].request("GET anonce")
+ if anonce1 == anonce2:
+ raise Exception("AP did not update ANonce in requested PTK rekeying")
+ hwsim_utils.test_connectivity(dev[0], hapd)
+
@remote_compatible
def test_ap_wpa2_ptk_rekey_ap(dev, apdev):
"""WPA2-PSK AP and PTK rekey enforced by AP"""