logger.info("Curve: " + curve)
logger.info("URI: " + uri)
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
res = dev[1].dpp_qr_code(uri)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d" % res):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d" % id1):
raise Exception("Failed to initiate DPP Authentication")
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN 2412"
- if netrole:
- cmd += " netrole=" + netrole
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, netrole=netrole)
cmd = "DPP_AUTH_INIT peer=%d" % id1
if init_extra:
cmd += " " + init_extra
id0b = dev[0].dpp_qr_code(uri1b)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412 qr=mutual"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, qr="mutual")
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412 qr=mutual"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, qr="mutual")
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d" % (id1)):
raise Exception("Failed to initiate DPP Authentication")
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412 qr=mutual"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, qr="mutual")
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
logger.info("dev0 does not scan QR Code")
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d own=%d" % (id1, id1b)):
raise Exception("Failed to initiate DPP Authentication")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0b)
logger.info("dev0 initiates DPP Authentication")
- if "OK" not in hapd.request("DPP_LISTEN 2412 qr=mutual"):
- raise Exception("Failed to start listen operation")
+ hapd.dpp_listen(2412, qr="mutual")
if "OK" not in dev[0].request("DPP_AUTH_INIT peer=%d own=%d" % (id0, id0b)):
raise Exception("Failed to initiate DPP Authentication")
logger.info("dev1 scans QR Code")
id1 = dev[1].dpp_qr_code(uri0)
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
logger.info("Wait for listen to expire and get restarted")
time.sleep(5.5)
logger.info("dev1 initiates DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d role=enrollee" % id1):
raise Exception("Failed to initiate DPP Authentication")
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN 2412"
- if resp_role:
- cmd += " role=" + resp_role
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, role=resp_role)
if "OK" not in dev[1].request("DPP_AUTH_INIT peer=%d role=either" % id1):
raise Exception("Failed to initiate DPP Authentication")
ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5)
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- if "OK" not in dev[0].request("DPP_LISTEN 2412 role=%s" % role):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, role=role)
return id1
def test_dpp_qr_code_auth_incompatible_roles(dev, apdev):
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d configurator=%d conf=sta-dpp neg_freq=2462" % (id1, conf_id)
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
logger.info("dev1 initiates DPP Authentication")
dev[0].set("ext_mgmt_frame_handling", "1")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
# Force GAS fragmentation
conf = '{"wi-fi_tech":"infra", "discovery":{"ssid":"test"},"cred":{"akm":"psk","pass":"secret passphrase"}}' + 3000*' '
raise Exception("Failed to add configurator (reconf)")
conf_id = int(res)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[1].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[1].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-dpp configurator=%d" % (id0b, conf_id)
if "OK" not in dev[0].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-dpp configurator=%d" % (id1, conf_id)
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=%s ssid=%s pass=%s" % (id1, conf,
binascii.hexlify(b"dpp-legacy").decode(),
binascii.hexlify(b"secret passphrase").decode())
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk ssid=%s pass=%s" % (id1,
binascii.hexlify(b"dpp-legacy").decode(),
binascii.hexlify(b"secret passphrase").decode())
dev[0].set("dpp_configurator_params",
" conf=sta-dpp configurator=%d%s" % (conf_id, extra))
- cmd = "DPP_LISTEN 2412 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, role="configurator")
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
dev[0].set("dpp_configurator_params",
" conf=ap-dpp configurator=%d" % conf_id)
- cmd = "DPP_LISTEN 2437 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2437, role="configurator")
id1 = hapd.dpp_qr_code(uri0)
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
dev[0].set("dpp_configurator_params",
" conf=ap-dpp configurator=%d" % conf_id)
- cmd = "DPP_LISTEN 2462 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2462, role="configurator")
id1 = hapd.dpp_qr_code(uri0)
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
id1peer = dev[1].dpp_qr_code(uri0)
id0peer = dev[0].dpp_qr_code(uri1)
- cmd = "DPP_LISTEN 2462 qr=mutual"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2462, qr="mutual")
cmd = "DPP_AUTH_INIT peer=%d own=%d neg_freq=2412" % (id1peer, id1)
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate operation")
id1peer = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2462"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2462)
cmd = "DPP_AUTH_INIT peer=%d own=%d neg_freq=2412" % (id1peer, id1)
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate operation")
id1peer = dev[1].dpp_qr_code(uri0)
id0peer = dev[0].dpp_qr_code(uri1)
- cmd = "DPP_LISTEN 2462 qr=mutual"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2462, qr="mutual")
cmd = "DPP_AUTH_INIT peer=%d own=%d neg_freq=2412" % (id1peer, id1)
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate operation")
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
identifier = " identifier=" + identifier_i if identifier_i else ""
cmd = "DPP_PKEX_ADD own=%d%s init=1 %s code=secret" % (id1, identifier,
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 5745"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(5745)
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=secret" % (id1)
res = dev[1].request(cmd)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
cmd = "DPP_PKEX_ADD own=%d identifier=%s init=1 code=%s" % (id1, identifier, code)
res = dev[1].request(cmd)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=unknown" % id1
res = dev[1].request(cmd)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
for i in range(5):
dev[0].dump_monitor()
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=secret" % id1
res = dev[1].request(cmd)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with alloc_fail(dev[0], 1, func):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=secret" % id1
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with fail_test(dev[1], 1, "dpp_pkex_derive_Qr;dpp_pkex_rx_exchange_resp"):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=secret" % id1
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with alloc_fail(dev[0], 1,
"dpp_get_pubkey_point;dpp_pkex_rx_commit_reveal_req"):
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437, role="configurator")
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 role=enrollee %s code=secret" % (id1, init_extra)
res = dev[1].request(cmd)
res = dev[1].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[1].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[1].dpp_listen(2437)
ev = dev[1].wait_event(["DPP-AUTH-SUCCESS"], timeout=10)
if ev is None:
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder/wpa_supplicant)")
- cmd = "DPP_LISTEN 2437 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2437, role="configurator")
id_h = hapd.dpp_bootstrap_gen(type="pkex")
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 role=enrollee code=secret" % (id_h)
if "mac_addr=" + dev[0].own_addr() not in res:
raise Exception("DPP_BOOTSTRAP_INFO did not report correct mac_addr")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d configurator=%d conf=sta-dpp" % (id1, conf_id)
if "OK" not in hapd.request(cmd):
raise Exception("Failed to initiate DPP Authentication")
id = hapd.dpp_qr_code(uri)
dev[0].set("dpp_config_processing", "2")
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-dpp configurator=%d%s" % (id, conf_id, extra)
if "OK" not in hapd.request(cmd):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
dev[1].set("dpp_groups_override", '[{"groupId":"b","netRole":"sta"}]')
cmd = "DPP_AUTH_INIT peer=%d conf=sta-dpp configurator=%d" % (id1, conf_id)
if "OK" not in dev[1].request(cmd):
id1 = dev[1].dpp_qr_code(uri2)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[2].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[2].dpp_listen(2412)
res = dev[1].request("DPP_CONFIGURATOR_ADD")
if "FAIL" in res:
raise Exception("Failed to add configurator")
id1 = dev[1].dpp_qr_code(uri5)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in wpas.request(cmd):
- raise Exception("Failed to start listen operation")
-
+ wpas.dpp_listen(2412)
dev[1].set("dpp_groups_override", '')
cmd = "DPP_AUTH_INIT peer=%d conf=sta-dpp configurator=%d" % (id1, conf_id)
if "OK" not in dev[1].request(cmd):
uri1b = dev[1].request("DPP_BOOTSTRAP_GET_URI %d" % id1b)
id0b = dev[0].dpp_qr_code(uri1b)
-
- cmd = "DPP_LISTEN 2412 qr=mutual"
+ qr = "mutual"
else:
- cmd = "DPP_LISTEN 2412"
+ qr = None
if init_enrollee:
if incompatible_roles:
- cmd += " role=enrollee"
+ role = "enrollee"
else:
- cmd += " role=configurator"
+ role = "configurator"
dev[0].set("dpp_configurator_params",
" conf=sta-dpp configurator=%d" % conf_id)
elif incompatible_roles:
- cmd += " role=enrollee"
+ role = "enrollee"
+ else:
+ role = None
if listen:
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, qr=qr, role=role)
if init_enrollee:
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % (id1)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 code=secret" % id1
res = dev[1].request(cmd)
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN %d" % listen_freq
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(listen_freq)
cmd = "DPP_AUTH_INIT peer=%d" % id1
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with alloc_fail(dev[1], count, func):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with alloc_fail(dev[0], count, func):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with fail_test(dev[1], count, func):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
res = dev[0].request(cmd)
if "FAIL" in res:
raise Exception("Failed to set PKEX data (responder)")
- cmd = "DPP_LISTEN 2437"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2437)
with fail_test(dev[0], count, func):
cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
dev[0].set("dpp_config_obj_override", conf)
dev[0].set("ext_mgmt_frame_handling", "1")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
with alloc_fail(dev[1], 1, "dpp_autogen_bootstrap_key"):
cmd = "DPP_AUTH_INIT peer=%d" % id1
if "FAIL" not in dev[1].request(cmd):
id1 = dev[1].dpp_qr_code(uri0)
logger.info("dev1 initiates DPP Authentication")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d" % id1
with fail_test(dev[1], 1, "aes_siv_decrypt;dpp_auth_resp_rx"):
if "OK" not in dev[1].request(cmd):
dev[0].set("dpp_configurator_params",
" conf=sta-psk ssid=%s" % (binascii.hexlify(b"dpp-legacy").decode()))
- cmd = "DPP_LISTEN 2412 role=configurator"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412, role="configurator")
# No pass/psk
cmd = "DPP_AUTH_INIT peer=%d role=enrollee" % id1
id1 = dev[1].dpp_qr_code(uri0)
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk pass=%s ssid=%s" % (id1,
binascii.hexlify(b"passphrase").decode(),
binascii.hexlify(b"dpp-legacy").decode())
id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
+ dev[0].dpp_listen(2412)
time.sleep(5.1)
id = dev[1].dpp_qr_code(uri)
id = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id)
- if "OK" not in dev[0].request("DPP_LISTEN 2412"):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
id1 = dev[1].dpp_qr_code(uri)
id2 = dev[2].dpp_qr_code(uri)
dev[0].set("ext_mgmt_frame_handling", "1")
dev[1].set("ext_mgmt_frame_handling", "1")
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d" % id1
if "OK" not in dev[1].request(cmd):
raise Exception("Failed to initiate DPP Authentication")
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-sae ssid=%s pass=%s" % (id1,
binascii.hexlify(b"dpp-legacy").decode(),
binascii.hexlify(b"secret passphrase").decode())
id1 = dev[1].dpp_qr_code(uri0)
- cmd = "DPP_LISTEN 2412"
- if "OK" not in dev[0].request(cmd):
- raise Exception("Failed to start listen operation")
-
+ dev[0].dpp_listen(2412)
cmd = "DPP_AUTH_INIT peer=%d conf=sta-psk-sae-dpp ssid=%s pass=%s configurator=%d" % \
(id1, binascii.hexlify(ssid.encode()).decode(),
binascii.hexlify(passphrase.encode()).decode(), conf_id)