tests: DPP QR Code and enrollee initiating with netrole specified

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2020-02-11 06:35:15 +02:00
parent de08fae66a
commit d299756e3e
2 changed files with 27 additions and 1 deletions

View file

@ -1954,6 +1954,30 @@ def run_dpp_qr_code_auth_responder_configurator(dev, apdev, extra):
wait_auth_success(dev[0], dev[1], configurator=dev[0], enrollee=dev[1], wait_auth_success(dev[0], dev[1], configurator=dev[0], enrollee=dev[1],
stop_responder=True) stop_responder=True)
def test_dpp_qr_code_auth_enrollee_init_netrole(dev, apdev):
"""DPP QR Code and enrollee initiating with netrole specified"""
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
conf_id = dev[0].dpp_configurator_add()
id0 = dev[0].dpp_bootstrap_gen(chan="81/1", mac=True)
uri0 = dev[0].request("DPP_BOOTSTRAP_GET_URI %d" % id0)
dev[0].set("dpp_configurator_params",
" conf=configurator configurator=%d" % conf_id)
dev[0].dpp_listen(2412, role="configurator")
dev[1].dpp_auth_init(uri=uri0, role="enrollee", netrole="configurator")
wait_auth_success(dev[0], dev[1], configurator=dev[0], enrollee=dev[1],
stop_responder=True)
dev[0].dump_monitor()
dev[1].dump_monitor()
# verify that netrole resets back to sta, if not explicitly stated
dev[0].set("dpp_configurator_params",
"conf=sta-dpp configurator=%d" % conf_id)
dev[0].dpp_listen(2412, role="configurator")
dev[1].dpp_auth_init(uri=uri0, role="enrollee")
wait_auth_success(dev[0], dev[1], configurator=dev[0], enrollee=dev[1],
stop_responder=True)
def test_dpp_qr_code_hostapd_init(dev, apdev): def test_dpp_qr_code_hostapd_init(dev, apdev):
"""DPP QR Code and hostapd as initiator""" """DPP QR Code and hostapd as initiator"""
check_dpp_capab(dev[0]) check_dpp_capab(dev[0])

View file

@ -1476,7 +1476,7 @@ class WpaSupplicant:
extra=None, own=None, role=None, neg_freq=None, extra=None, own=None, role=None, neg_freq=None,
ssid=None, passphrase=None, expect_fail=False, ssid=None, passphrase=None, expect_fail=False,
tcp_addr=None, tcp_port=None, conn_status=False, tcp_addr=None, tcp_port=None, conn_status=False,
ssid_charset=None, nfc_uri=None): ssid_charset=None, nfc_uri=None, netrole=None):
cmd = "DPP_AUTH_INIT" cmd = "DPP_AUTH_INIT"
if peer is None: if peer is None:
if nfc_uri: if nfc_uri:
@ -1508,6 +1508,8 @@ class WpaSupplicant:
cmd += " tcp_port=" + tcp_port cmd += " tcp_port=" + tcp_port
if conn_status: if conn_status:
cmd += " conn_status=1" cmd += " conn_status=1"
if netrole:
cmd += " netrole=" + netrole
res = self.request(cmd) res = self.request(cmd)
if expect_fail: if expect_fail:
if "FAIL" not in res: if "FAIL" not in res: