|
@@ -8,6 +8,7 @@ import logging
|
|
|
logger = logging.getLogger()
|
|
|
|
|
|
import hostapd
|
|
|
+import hwsim_utils
|
|
|
|
|
|
def test_ap_wpa2_psk(dev, apdev):
|
|
|
"""WPA2-PSK AP with PSK instead of passphrase"""
|
|
@@ -39,3 +40,15 @@ def test_ap_wpa2_psk_file(dev, apdev):
|
|
|
if ev is None:
|
|
|
raise Exception("Timed out while waiting for failure report")
|
|
|
dev[1].request("REMOVE_NETWORK all")
|
|
|
+
|
|
|
+def test_ap_wpa_ptk_rekey(dev, apdev):
|
|
|
+ """WPA-PSK/TKIP AP and PTK rekey enforced by station"""
|
|
|
+ ssid = "test-wpa-psk"
|
|
|
+ passphrase = 'qwertyuiop'
|
|
|
+ params = hostapd.wpa_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'])
|