diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index f9becfcef..4252c43ba 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -508,7 +508,7 @@ class Hostapd: 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: @@ -516,10 +516,9 @@ class Hostapd: 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: diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 94f8c59a3..12b4becf0 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -2270,7 +2270,7 @@ def test_dpp_pkex(dev, apdev): 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)""" @@ -2325,14 +2325,14 @@ def test_dpp_pkex_identifier_mismatch3(dev, apdev): 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) @@ -2565,7 +2565,7 @@ def test_dpp_pkex_v2_hostapd_responder(dev, apdev): 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) @@ -2596,7 +2596,7 @@ def test_dpp_pkex_v2_hostapd_initiator(dev, apdev): 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) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 160aa3e2d..1f4a6e048 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -1577,7 +1577,7 @@ class WpaSupplicant: 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: @@ -1585,10 +1585,9 @@ class WpaSupplicant: 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: