aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2020-05-25 20:24:55 (GMT)
committerJouni Malinen <j@w1.fi>2020-05-25 20:24:55 (GMT)
commitb96a3bd5dfe21656a9fe2d4fce0f428da483d7fe (patch)
treec32c7a2a5fe93c12f57edd7099552c13923d0b52
parent38163b193eff2444f1422d631afe9f76ef3ea922 (diff)
downloadhostap-b96a3bd5dfe21656a9fe2d4fce0f428da483d7fe.zip
hostap-b96a3bd5dfe21656a9fe2d4fce0f428da483d7fe.tar.gz
hostap-b96a3bd5dfe21656a9fe2d4fce0f428da483d7fe.tar.bz2
tests: sigma_dut controlled STA using OCV
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--tests/hwsim/test_sigma_dut.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py
index 070a2a5..b87f44b 100644
--- a/tests/hwsim/test_sigma_dut.py
+++ b/tests/hwsim/test_sigma_dut.py
@@ -4587,3 +4587,48 @@ def test_sigma_dut_ap_ft_rsnxe_used_mismatch(dev, apdev, params):
sigma_dut_cmd_check("ap_reset_default")
finally:
stop_sigma_dut(sigma)
+
+def test_sigma_dut_ocv(dev, apdev):
+ """sigma_dut controlled STA using OCV"""
+ if "SAE" not in dev[0].get_capability("auth_alg"):
+ raise HwsimSkip("SAE not supported")
+
+ ifname = dev[0].ifname
+ sigma = start_sigma_dut(ifname)
+
+ try:
+ ssid = "test-sae"
+ params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
+ params['wpa_key_mgmt'] = 'SAE'
+ params["ieee80211w"] = "2"
+ params['sae_groups'] = '19'
+ params['ocv'] = '1'
+ hapd = hostapd.add_ap(apdev[0], params)
+
+ sigma_dut_cmd_check("sta_reset_default,interface,%s,prog,WPA3" % ifname)
+ sigma_dut_cmd_check("sta_set_ip_config,interface,%s,dhcp,0,ip,127.0.0.11,mask,255.255.255.0" % ifname)
+ sigma_dut_cmd_check("sta_set_wireless,interface,%s,program,WPA3,ocvc,1" % ifname)
+ sigma_dut_cmd_check("sta_set_security,interface,%s,ssid,%s,passphrase,%s,type,SAE,encpType,aes-ccmp,keymgmttype,wpa2" % (ifname, "test-sae", "12345678"))
+ sigma_dut_cmd_check("sta_associate,interface,%s,ssid,%s,channel,1" % (ifname, "test-sae"),
+ timeout=10)
+ sigma_dut_wait_connected(ifname)
+
+ sigma_dut_cmd_check("sta_reset_default,interface,%s,prog,WPA3" % ifname)
+ sigma_dut_cmd_check("sta_set_ip_config,interface,%s,dhcp,0,ip,127.0.0.11,mask,255.255.255.0" % ifname)
+ sigma_dut_cmd_check("sta_set_wireless,interface,%s,program,WPA3,ocvc,1" % ifname)
+ sigma_dut_cmd_check("sta_set_rfeature,interface,%s,prog,WPA3,OCIFrameType,eapolM2,OCIChannel,11" % ifname)
+ sigma_dut_cmd_check("sta_set_security,interface,%s,ssid,%s,passphrase,%s,type,SAE,encpType,aes-ccmp,keymgmttype,wpa2" % (ifname, "test-sae", "12345678"))
+ sigma_dut_cmd_check("sta_associate,interface,%s,ssid,%s,channel,1" % (ifname, "test-sae"))
+ ev = hapd.wait_event(["OCV-FAILURE"], timeout=1)
+ if ev is None:
+ raise Exception("OCV failure for EAPOL-Key msg 2/4 not reported")
+ if "addr=" + dev[0].own_addr() not in ev:
+ raise Exception("Unexpected OCV failure addr: " + ev)
+ if "frame=eapol-key-m2" not in ev:
+ raise Exception("Unexpected OCV failure frame: " + ev)
+ if "error=primary channel mismatch" not in ev:
+ raise Exception("Unexpected OCV failure error: " + ev)
+
+ sigma_dut_cmd_check("sta_reset_default,interface," + ifname)
+ finally:
+ stop_sigma_dut(sigma)