finally:
dev[0].set("sae_pwe", "0")
+def test_ap_ft_rsnxe_only_from_sta(dev, apdev):
+ """FT with RSNXE only from STA"""
+ hapd0, hapd1 = start_ft_sae(dev[0], apdev, sae_pwe="0")
+ hapd1.disable()
+ dev[0].scan_for_bss(hapd0.own_addr(), freq=2412)
+ hapd0.set("ext_mgmt_frame_handling", "1")
+ dev[0].connect("test-ft", key_mgmt="FT-SAE", sae_password="12345678",
+ sae_pwe="2", wait_connect=False)
+
+ for j in range(2):
+ for i in range(0, 10):
+ req = hapd0.mgmt_rx()
+ if req is None:
+ raise Exception("MGMT RX wait timed out (authentication)")
+ if req['subtype'] == 11:
+ break
+ req = None
+ if not req:
+ raise Exception("Authentication frame not received")
+
+ hapd0.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode())
+
+ for i in range(0, 10):
+ req = hapd0.mgmt_rx()
+ if req is None:
+ raise Exception("MGMT RX wait timed out (association)")
+ if req['subtype'] == 0:
+ break
+ req = None
+ if not req:
+ raise Exception("Association Request frame not received")
+
+ hapd0.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + binascii.hexlify(req['frame']).decode())
+ ev = hapd0.wait_event(["MGMT-TX-STATUS"], timeout=5)
+ if ev is None:
+ raise Exception("Management frame TX status not reported (1)")
+ if "stype=1 ok=1" not in ev:
+ raise Exception("Unexpected management frame TX status (1): " + ev)
+ cmd = "MGMT_TX_STATUS_PROCESS %s" % (" ".join(ev.split(' ')[1:4]))
+ if "OK" not in hapd0.request(cmd):
+ raise Exception("MGMT_TX_STATUS_PROCESS failed")
+
+ dev[0].wait_connected()
+ hapd0.set("ext_mgmt_frame_handling", "0")
+
+ ies = parse_ie(binascii.hexlify(req['payload'][4:]))
+ if 244 not in ies:
+ raise Exception("RSNXE not included in Association Request frame for initial mobility domain association")
+
def test_ap_ft_sae_h2e_downgrade_attack(dev, apdev):
"""WPA2-PSK-FT-SAE AP (H2E downgrade attack)"""
try: