test: DPP 3rd party config information
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
68209ddbe4
commit
f2bb0839fb
2 changed files with 43 additions and 1 deletions
|
@ -1038,6 +1038,28 @@ def test_dpp_config_dpp_gen_expired_key(dev, apdev):
|
|||
require_conf_failure=True,
|
||||
configurator=True)
|
||||
|
||||
def test_dpp_config_dpp_gen_3rd_party(dev, apdev):
|
||||
"""Generate DPP Config Object for DPP network with 3rd party information"""
|
||||
check_dpp_capab(dev[0])
|
||||
check_dpp_capab(dev[1])
|
||||
try:
|
||||
dev[0].set("dpp_extra_conf_req_name", "org.example")
|
||||
json = '{"c":1,"d":"test"}'
|
||||
dev[0].set("dpp_extra_conf_req_value", json)
|
||||
run_dpp_config_dpp_gen_3rd_party(dev, apdev)
|
||||
finally:
|
||||
dev[0].set("dpp_extra_conf_req_name", "", allow_fail=True)
|
||||
dev[0].set("dpp_extra_conf_req_value", "", allow_fail=True)
|
||||
|
||||
def run_dpp_config_dpp_gen_3rd_party(dev, apdev):
|
||||
extra = "conf_extra_name=org.example conf_extra_value="
|
||||
json = '{"a":1,"b":"test"}'
|
||||
extra += binascii.hexlify(json.encode()).decode()
|
||||
run_dpp_qr_code_auth_unicast(dev, apdev, "prime256v1",
|
||||
init_extra="conf=sta-dpp " + extra,
|
||||
require_conf_success=True,
|
||||
configurator=True)
|
||||
|
||||
def test_dpp_config_dpp_override_prime256v1(dev, apdev):
|
||||
"""DPP Config Object override (P-256)"""
|
||||
check_dpp_capab(dev[0])
|
||||
|
|
|
@ -2062,6 +2062,16 @@ def test_sigma_dut_dpp_qr_init_configurator_nak_from_uri(dev, apdev):
|
|||
run_sigma_dut_dpp_qr_init_configurator(dev, apdev, 1,
|
||||
net_access_key_curve="URI")
|
||||
|
||||
def test_sigma_dut_dpp_qr_init_configurator_3rd_party(dev, apdev):
|
||||
"""sigma_dut DPP/QR initiator as Configurator (3rd party info)"""
|
||||
run_sigma_dut_dpp_qr_init_configurator(dev, apdev, 1,
|
||||
extra="DPP3rdParty,Yes")
|
||||
|
||||
def test_sigma_dut_dpp_qr_init_configurator_3rd_party_psk(dev, apdev):
|
||||
"""sigma_dut DPP/QR initiator as Configurator (3rd party info with PSK)"""
|
||||
run_sigma_dut_dpp_qr_init_configurator(dev, apdev, 2,
|
||||
extra="DPP3rdParty,Yes")
|
||||
|
||||
def run_sigma_dut_dpp_qr_init_configurator(dev, apdev, conf_idx,
|
||||
prov_role="Configurator",
|
||||
extra=None, mud_url=None,
|
||||
|
@ -2205,6 +2215,13 @@ def test_sigma_dut_dpp_incompatible_roles_resp(dev, apdev):
|
|||
|
||||
def test_sigma_dut_dpp_qr_enrollee_chirp(dev, apdev):
|
||||
"""sigma_dut DPP/QR as chirping Enrollee"""
|
||||
run_sigma_dut_dpp_qr_enrollee_chirp(dev, apdev)
|
||||
|
||||
def test_sigma_dut_dpp_qr_enrollee_chirp_3rd_party_info(dev, apdev):
|
||||
"""sigma_dut DPP/QR as chirping Enrollee (3rd party info in request)"""
|
||||
run_sigma_dut_dpp_qr_enrollee_chirp(dev, apdev, extra="DPP3rdParty,Yes")
|
||||
|
||||
def run_sigma_dut_dpp_qr_enrollee_chirp(dev, apdev, extra=None):
|
||||
check_dpp_capab(dev[0])
|
||||
check_dpp_capab(dev[1])
|
||||
hapd = start_dpp_ap(apdev[0])
|
||||
|
@ -2226,7 +2243,10 @@ def test_sigma_dut_dpp_qr_enrollee_chirp(dev, apdev):
|
|||
ssid="DPPNET01")
|
||||
dev[1].dpp_listen(2437)
|
||||
|
||||
res = sigma_dut_cmd_check("dev_exec_action,program,DPP,DPPActionType,AutomaticDPP,DPPAuthRole,Responder,DPPAuthDirection,Single,DPPProvisioningRole,Enrollee,DPPBS,QR,DPPTimeout,16,DPPWaitForConnect,Yes,DPPChirp,Enable", timeout=20)
|
||||
cmd = "dev_exec_action,program,DPP,DPPActionType,AutomaticDPP,DPPAuthRole,Responder,DPPAuthDirection,Single,DPPProvisioningRole,Enrollee,DPPBS,QR,DPPTimeout,16,DPPWaitForConnect,Yes,DPPChirp,Enable"
|
||||
if extra:
|
||||
cmd += "," + extra
|
||||
res = sigma_dut_cmd_check(cmd, timeout=20)
|
||||
sigma_dut_cmd_check("sta_reset_default,interface,%s,prog,DPP" % ifname)
|
||||
if "BootstrapResult,OK,AuthResult,OK,ConfResult,OK,NetworkIntroResult,OK,NetworkConnectResult,OK" not in res:
|
||||
raise Exception("Unexpected result: " + res)
|
||||
|
|
Loading…
Reference in a new issue