raise Exception("Failed to initiate DPP Authentication")
def dpp_pkex_init(self, identifier, code, role=None, key=None, curve=None,
- extra=None, use_id=None, v2=False):
+ extra=None, use_id=None, ver=None):
if use_id is None:
id1 = self.dpp_bootstrap_gen(type="pkex", key=key, curve=curve)
else:
cmd = "own=%d " % id1
if identifier:
cmd += "identifier=%s " % identifier
- if v2:
- cmd += "init=2 "
- else:
- cmd += "init=1 "
+ cmd += "init=1 "
+ if ver is not None:
+ cmd += "ver=" + str(ver) + " "
if role:
cmd += "role=%s " % role
if extra:
def test_dpp_pkex_v2(dev, apdev):
"""DPP and PKEXv2"""
- run_dpp_pkex(dev, apdev, v2=True)
+ run_dpp_pkex(dev, apdev, ver=2)
def test_dpp_pkex_p256(dev, apdev):
"""DPP and PKEX (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, v2=False):
- min_ver = 3 if v2 else 1
+ expect_no_resp=False, ver=None):
+ min_ver = 3 if ver else 1
check_dpp_capab(dev[0], curve and "brainpool" in curve, min_ver=min_ver)
check_dpp_capab(dev[1], curve and "brainpool" in curve, min_ver=min_ver)
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, v2=v2)
+ extra=init_extra, ver=ver)
if expect_no_resp:
ev = dev[0].wait_event(["DPP-RX"], timeout=10)
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)
+ extra="conf=ap-dpp configurator=%d" % conf_id, ver=2)
wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
stop_initiator=True)
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)
+ ver=2)
wait_auth_success(hapd, dev[0], configurator=dev[0], enrollee=hapd,
stop_initiator=True)
return int(peer)
def dpp_pkex_init(self, identifier, code, role=None, key=None, curve=None,
- extra=None, use_id=None, allow_fail=False, v2=False):
+ extra=None, use_id=None, allow_fail=False, ver=None):
if use_id is None:
id1 = self.dpp_bootstrap_gen(type="pkex", key=key, curve=curve)
else:
cmd = "own=%d " % id1
if identifier:
cmd += "identifier=%s " % identifier
- if v2:
- cmd += "init=2 "
- else:
- cmd += "init=1 "
+ cmd += "init=1 "
+ if ver is not None:
+ cmd += "ver=" + str(ver) + " "
if role:
cmd += "role=%s " % role
if extra: