tests: DPP curve change for netAccessKey

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-03-09 01:05:17 +02:00 committed by Jouni Malinen
parent de64dfe98e
commit 117dc4ea41
3 changed files with 21 additions and 4 deletions

View file

@ -541,10 +541,13 @@ class Hostapd:
raise Exception("Failed to set PKEX data (responder)")
self.dpp_listen(freq, role=listen_role)
def dpp_configurator_add(self, curve=None, key=None):
def dpp_configurator_add(self, curve=None, key=None,
net_access_key_curve=None):
cmd = "DPP_CONFIGURATOR_ADD"
if curve:
cmd += " curve=" + curve
if net_access_key_curve:
cmd += " net_access_key_curve=" + curve
if key:
cmd += " key=" + key
res = self.request(cmd)

View file

@ -374,13 +374,15 @@ def run_dpp_qr_code_auth_unicast(dev, apdev, curve, netrole=None, key=None,
require_conf_success=False, init_extra=None,
require_conf_failure=False,
configurator=False, conf_curve=None,
net_access_key_curve=None,
conf=None, qr=None, stop_responder=True):
brainpool = (curve and "brainpool" in curve) or \
(conf_curve and "brainpool" in conf_curve)
check_dpp_capab(dev[0], brainpool)
check_dpp_capab(dev[1], brainpool)
if configurator:
conf_id = dev[1].dpp_configurator_add(curve=conf_curve)
conf_id = dev[1].dpp_configurator_add(curve=conf_curve,
net_access_key_curve=net_access_key_curve)
else:
conf_id = None
@ -401,7 +403,7 @@ def run_dpp_qr_code_auth_unicast(dev, apdev, curve, netrole=None, key=None,
dev[1].dpp_auth_init(uri=uri0, extra=init_extra, configurator=conf_id,
conf=conf, own=id1)
wait_auth_success(dev[0], dev[1], configurator=dev[1], enrollee=dev[0],
allow_enrollee_failure=True,
allow_enrollee_failure=not require_conf_success,
allow_configurator_failure=not require_conf_success,
require_configurator_failure=require_conf_failure,
stop_responder=stop_responder)
@ -957,6 +959,15 @@ def test_dpp_config_dpp_gen_secp521r1_secp521r1(dev, apdev):
configurator=True,
conf_curve="secp521r1")
def test_dpp_config_dpp_gen_prime256v1_secp384r1_secp384r1(dev, apdev):
"""Generate DPP Config Object for DPP network (P-256 + P-384 + P-384)"""
run_dpp_qr_code_auth_unicast(dev, apdev, "prime256v1",
init_extra="conf=sta-dpp",
require_conf_success=True,
configurator=True,
conf_curve="secp384r1",
net_access_key_curve="secp384r1")
def test_dpp_config_dpp_gen_expiry(dev, apdev):
"""Generate DPP Config Object for DPP network with expiry value"""
run_dpp_qr_code_auth_unicast(dev, apdev, "prime256v1",

View file

@ -1621,10 +1621,13 @@ class WpaSupplicant:
self.dpp_listen(freq, role=listen_role)
return id0
def dpp_configurator_add(self, curve=None, key=None):
def dpp_configurator_add(self, curve=None, key=None,
net_access_key_curve=None):
cmd = "DPP_CONFIGURATOR_ADD"
if curve:
cmd += " curve=" + curve
if net_access_key_curve:
cmd += " net_access_key_curve=" + curve
if key:
cmd += " key=" + key
res = self.request(cmd)