"""DPP and PKEX"""
run_dpp_pkex(dev, apdev)
+def test_dpp_pkex_v2(dev, apdev):
+ """DPP and PKEXv2"""
+ run_dpp_pkex(dev, apdev, v2=True)
+
def test_dpp_pkex_p256(dev, apdev):
"""DPP and PKEX (P-256)"""
run_dpp_pkex(dev, apdev, "P-256")
def run_dpp_pkex(dev, apdev, curve=None, init_extra=None, check_config=False,
identifier_i="test", identifier_r="test",
- expect_no_resp=False):
+ expect_no_resp=False, v2=False):
check_dpp_capab(dev[0], curve and "brainpool" in curve)
check_dpp_capab(dev[1], curve and "brainpool" in curve)
dev[0].dpp_pkex_resp(2437, identifier=identifier_r, code="secret",
curve=curve)
dev[1].dpp_pkex_init(identifier=identifier_i, code="secret", curve=curve,
- extra=init_extra)
+ extra=init_extra, v2=v2)
if expect_no_resp:
ev = dev[0].wait_event(["DPP-RX"], timeout=10)
wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
stop_initiator=True)
+def test_dpp_pkex_v2_hostapd_responder(dev, apdev):
+ """DPP PKEXv2 with hostapd as responder"""
+ check_dpp_capab(dev[0])
+ hapd = hostapd.add_ap(apdev[0], {"ssid": "unconfigured",
+ "channel": "6"})
+ check_dpp_capab(hapd)
+ hapd.dpp_pkex_resp(2437, identifier="test", code="secret")
+ conf_id = dev[0].dpp_configurator_add()
+ dev[0].dpp_pkex_init(identifier="test", code="secret",
+ extra="conf=ap-dpp configurator=%d" % conf_id, v2=True)
+ wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
+ stop_initiator=True)
+
def test_dpp_pkex_hostapd_initiator(dev, apdev):
"""DPP PKEX with hostapd as initiator"""
check_dpp_capab(dev[0])
wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
stop_initiator=True)
+def test_dpp_pkex_v2_hostapd_initiator(dev, apdev):
+ """DPP PKEXv2 with hostapd as initiator"""
+ check_dpp_capab(dev[0])
+ hapd = hostapd.add_ap(apdev[0], {"ssid": "unconfigured",
+ "channel": "6"})
+ check_dpp_capab(hapd)
+ conf_id = dev[0].dpp_configurator_add()
+ dev[0].set("dpp_configurator_params",
+ " conf=ap-dpp configurator=%d" % conf_id)
+ dev[0].dpp_pkex_resp(2437, identifier="test", code="secret",
+ listen_role="configurator")
+ hapd.dpp_pkex_init(identifier="test", code="secret", role="enrollee",
+ v2=True)
+ wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
+ stop_initiator=True)
+
def test_dpp_pkex_hostapd_errors(dev, apdev):
"""DPP PKEX errors with hostapd"""
hapd = hostapd.add_ap(apdev[0], {"ssid": "unconfigured",