mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
tests: Supplicant-enforced PTK rekey
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
77b4a71180
commit
fb5c8cea95
@ -8,6 +8,7 @@ import logging
|
|||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
import hostapd
|
import hostapd
|
||||||
|
import hwsim_utils
|
||||||
|
|
||||||
def test_ap_wpa2_psk(dev, apdev):
|
def test_ap_wpa2_psk(dev, apdev):
|
||||||
"""WPA2-PSK AP with PSK instead of passphrase"""
|
"""WPA2-PSK AP with PSK instead of passphrase"""
|
||||||
@ -39,3 +40,15 @@ def test_ap_wpa2_psk_file(dev, apdev):
|
|||||||
if ev is None:
|
if ev is None:
|
||||||
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_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'])
|
||||||
|
@ -618,7 +618,8 @@ class WpaSupplicant:
|
|||||||
|
|
||||||
not_quoted = [ "proto", "key_mgmt", "ieee80211w", "pairwise",
|
not_quoted = [ "proto", "key_mgmt", "ieee80211w", "pairwise",
|
||||||
"group", "wep_key0", "scan_freq", "eap",
|
"group", "wep_key0", "scan_freq", "eap",
|
||||||
"eapol_flags", "fragment_size", "scan_ssid", "auth_alg" ]
|
"eapol_flags", "fragment_size", "scan_ssid", "auth_alg",
|
||||||
|
"wpa_ptk_rekey" ]
|
||||||
for field in not_quoted:
|
for field in not_quoted:
|
||||||
if field in kwargs and kwargs[field]:
|
if field in kwargs and kwargs[field]:
|
||||||
self.set_network(id, field, kwargs[field])
|
self.set_network(id, field, kwargs[field])
|
||||||
|
Loading…
Reference in New Issue
Block a user