aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-07-02 09:36:36 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-03 10:03:34 (GMT)
commitd86b86d034d00021bbb7b8fb5f18db5b6a2c16f6 (patch)
tree522b4f39422e140867763440e1acb3425892be33 /tests
parentb65b22d60ac9d013f8767f79fd6d5e65c0f6cb96 (diff)
downloadhostap-d86b86d034d00021bbb7b8fb5f18db5b6a2c16f6.zip
hostap-d86b86d034d00021bbb7b8fb5f18db5b6a2c16f6.tar.gz
hostap-d86b86d034d00021bbb7b8fb5f18db5b6a2c16f6.tar.bz2
tests: DPP auth responder acting as configurator
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_dpp.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py
index d0005cf..aa69806 100644
--- a/tests/hwsim/test_dpp.py
+++ b/tests/hwsim/test_dpp.py
@@ -1115,6 +1115,52 @@ def run_dpp_auto_connect_legacy(dev, apdev):
dev[0].wait_connected()
+def test_dpp_qr_code_auth_responder_configurator(dev, apdev):
+ """DPP QR Code and responder as the configurator"""
+ check_dpp_capab(dev[0])
+ check_dpp_capab(dev[1])
+ cmd = "DPP_CONFIGURATOR_ADD"
+ res = dev[0].request(cmd);
+ if "FAIL" in res:
+ raise Exception("Failed to add configurator")
+ conf_id = int(res)
+
+ addr = dev[0].own_addr().replace(':', '')
+ cmd = "DPP_BOOTSTRAP_GEN type=qrcode chan=81/1 mac=" + addr
+ res = dev[0].request(cmd)
+ if "FAIL" in res:
+ raise Exception("Failed to generate bootstrapping info")
+ id0 = int(res)
+ uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
+
+ res = dev[1].request("DPP_QR_CODE " + uri0)
+ if "FAIL" in res:
+ raise Exception("Failed to parse QR Code URI")
+ id1 = int(res)
+
+ dev[0].set("dpp_configurator_params", " conf=sta-dpp configurator=%d" % conf_id);
+ cmd = "DPP_LISTEN 2412 role=configurator"
+ if "OK" not in dev[0].request(cmd):
+ raise Exception("Failed to start listen operation")
+ cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
+ if "OK" not in dev[1].request(cmd):
+ raise Exception("Failed to initiate DPP Authentication")
+ ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication did not succeed (Responder)")
+ ev = dev[1].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
+ if ev is None:
+ raise Exception("DPP authentication did not succeed (Initiator)")
+ ev = dev[0].wait_event(["DPP-CONF-SENT"], timeout=5)
+ if ev is None:
+ raise Exception("DPP configuration not completed (Configurator)")
+ ev = dev[1].wait_event(["DPP-CONF-RECEIVED"], timeout=5)
+ if ev is None:
+ raise Exception("DPP configuration not completed (Enrollee)")
+ dev[0].request("DPP_STOP_LISTEN")
+ dev[0].dump_monitor()
+ dev[1].dump_monitor()
+
def test_dpp_pkex(dev, apdev):
"""DPP and PKEX"""
run_dpp_pkex(dev, apdev)