|
@@ -45,6 +45,32 @@ def test_ap_wpa2_psk_file(dev, apdev):
|
|
raise Exception("Timed out while waiting for failure report")
|
|
raise Exception("Timed out while waiting for failure report")
|
|
dev[1].request("REMOVE_NETWORK all")
|
|
dev[1].request("REMOVE_NETWORK all")
|
|
|
|
|
|
|
|
+def test_ap_wpa2_ptk_rekey(dev, apdev):
|
|
|
|
+ """WPA2-PSK AP and PTK rekey enforced by station"""
|
|
|
|
+ ssid = "test-wpa2-psk"
|
|
|
|
+ passphrase = 'qwertyuiop'
|
|
|
|
+ params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
|
|
|
|
+ hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
|
+ dev[0].connect(ssid, psk=passphrase, wpa_ptk_rekey="1", scan_freq="2412")
|
|
|
|
+ ev = dev[0].wait_event(["WPA: Key negotiation completed"])
|
|
|
|
+ if ev is None:
|
|
|
|
+ raise Exception("PTK rekey timed out")
|
|
|
|
+ hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
|
|
|
|
+
|
|
|
|
+def test_ap_wpa2_sha256_ptk_rekey(dev, apdev):
|
|
|
|
+ """WPA2-PSK/SHA256 AKM AP and PTK rekey enforced by station"""
|
|
|
|
+ ssid = "test-wpa2-psk"
|
|
|
|
+ passphrase = 'qwertyuiop'
|
|
|
|
+ params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
|
|
|
|
+ params["wpa_key_mgmt"] = "WPA-PSK-SHA256"
|
|
|
|
+ hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
|
+ dev[0].connect(ssid, psk=passphrase, key_mgmt="WPA-PSK-SHA256",
|
|
|
|
+ wpa_ptk_rekey="1", scan_freq="2412")
|
|
|
|
+ ev = dev[0].wait_event(["WPA: Key negotiation completed"])
|
|
|
|
+ if ev is None:
|
|
|
|
+ raise Exception("PTK rekey timed out")
|
|
|
|
+ hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
|
|
|
|
+
|
|
def test_ap_wpa_ptk_rekey(dev, apdev):
|
|
def test_ap_wpa_ptk_rekey(dev, apdev):
|
|
"""WPA-PSK/TKIP AP and PTK rekey enforced by station"""
|
|
"""WPA-PSK/TKIP AP and PTK rekey enforced by station"""
|
|
ssid = "test-wpa-psk"
|
|
ssid = "test-wpa-psk"
|