mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 10:54:03 -05:00
tests: IEEE 802.1X and HELD state
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
c8a15753eb
commit
e0236b152c
@ -160,6 +160,53 @@ def test_ieee8021x_eapol_start(dev, apdev):
|
|||||||
dev[0].request("SET EAPOL::startPeriod 30")
|
dev[0].request("SET EAPOL::startPeriod 30")
|
||||||
dev[0].request("SET EAPOL::maxStart 3")
|
dev[0].request("SET EAPOL::maxStart 3")
|
||||||
|
|
||||||
|
def test_ieee8021x_held(dev, apdev):
|
||||||
|
"""IEEE 802.1X and HELD state"""
|
||||||
|
params = hostapd.radius_params()
|
||||||
|
params["ssid"] = "ieee8021x-open"
|
||||||
|
params["ieee8021x"] = "1"
|
||||||
|
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||||
|
bssid = apdev[0]['bssid']
|
||||||
|
|
||||||
|
hapd.set("ext_eapol_frame_io", "1")
|
||||||
|
try:
|
||||||
|
dev[0].request("SET EAPOL::startPeriod 1")
|
||||||
|
dev[0].request("SET EAPOL::maxStart 0")
|
||||||
|
dev[0].request("SET EAPOL::heldPeriod 1")
|
||||||
|
dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
|
||||||
|
eap="PSK", identity="psk.user@example.com",
|
||||||
|
password_hex="0123456789abcdef0123456789abcdef",
|
||||||
|
scan_freq="2412", wait_connect=False)
|
||||||
|
held = False
|
||||||
|
for i in range(30):
|
||||||
|
pae = dev[0].get_status_field('Supplicant PAE state')
|
||||||
|
if pae == "HELD":
|
||||||
|
held = True
|
||||||
|
break
|
||||||
|
time.sleep(0.25)
|
||||||
|
if not held:
|
||||||
|
raise Exception("PAE state HELD not reached")
|
||||||
|
|
||||||
|
hapd.set("ext_eapol_frame_io", "0")
|
||||||
|
for i in range(30):
|
||||||
|
pae = dev[0].get_status_field('Supplicant PAE state')
|
||||||
|
if pae != "HELD":
|
||||||
|
held = False
|
||||||
|
break
|
||||||
|
time.sleep(0.25)
|
||||||
|
if held:
|
||||||
|
raise Exception("PAE state HELD not left")
|
||||||
|
ev = dev[0].wait_event([ "CTRL-EVENT-CONNECTED",
|
||||||
|
"CTRL-EVENT-DISCONNECTED" ], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("Connection timed out")
|
||||||
|
if "CTRL-EVENT-DISCONNECTED" in ev:
|
||||||
|
raise Exception("Unexpected disconnection")
|
||||||
|
finally:
|
||||||
|
dev[0].request("SET EAPOL::startPeriod 30")
|
||||||
|
dev[0].request("SET EAPOL::maxStart 3")
|
||||||
|
dev[0].request("SET EAPOL::heldPeriod 60")
|
||||||
|
|
||||||
def send_eapol_key(dev, bssid, signkey, frame_start, frame_end):
|
def send_eapol_key(dev, bssid, signkey, frame_start, frame_end):
|
||||||
zero_sign = "00000000000000000000000000000000"
|
zero_sign = "00000000000000000000000000000000"
|
||||||
frame = frame_start + zero_sign + frame_end
|
frame = frame_start + zero_sign + frame_end
|
||||||
|
Loading…
Reference in New Issue
Block a user