tests: DPP and SAE password identifier

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2024-09-01 16:33:26 +03:00 committed by Jouni Malinen
parent 0012c4433c
commit 3ab781fb29
2 changed files with 19 additions and 4 deletions

View file

@ -2322,6 +2322,15 @@ def test_dpp_auto_connect_legacy_sae_3(dev, apdev):
finally:
dev[0].set("dpp_config_processing", "0", allow_fail=True)
def test_dpp_auto_connect_legacy_sae_pw_id(dev, apdev):
"""DPP and auto connect (legacy SAE with password identifier)"""
check_dpp_capab(dev[0], min_ver=3)
try:
run_dpp_auto_connect_legacy(dev, apdev, conf='sta-sae', sae_only=True,
password_id="id")
finally:
dev[0].set("dpp_config_processing", "0", allow_fail=True)
def test_dpp_auto_connect_legacy_psk_sae_1(dev, apdev):
"""DPP and auto connect (legacy PSK+SAE)"""
try:
@ -2348,11 +2357,15 @@ def test_dpp_auto_connect_legacy_psk_sae_3(dev, apdev):
def run_dpp_auto_connect_legacy(dev, apdev, conf='sta-psk',
ssid_charset=None,
psk_sae=False, sae_only=False,
password="secret passphrase"):
password="secret passphrase",
password_id=None):
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
if sae_only:
if sae_only and password_id:
params = hostapd.wpa3_params(ssid="dpp-legacy",
password=password + '|id=' + password_id)
elif sae_only:
params = hostapd.wpa3_params(ssid="dpp-legacy",
password=password)
else:
@ -2373,7 +2386,7 @@ def run_dpp_auto_connect_legacy(dev, apdev, conf='sta-psk',
dev[0].dpp_listen(2412)
dev[1].dpp_auth_init(uri=uri0, conf=conf, ssid="dpp-legacy",
ssid_charset=ssid_charset,
passphrase=password)
passphrase=password, password_id=password_id)
wait_auth_success(dev[0], dev[1], configurator=dev[1], enrollee=dev[0])
if ssid_charset:
ev = dev[0].wait_event(["DPP-CONFOBJ-SSID-CHARSET"], timeout=1)

View file

@ -1592,7 +1592,7 @@ class WpaSupplicant:
ssid=None, passphrase=None, expect_fail=False,
tcp_addr=None, tcp_port=None, conn_status=False,
ssid_charset=None, nfc_uri=None, netrole=None,
csrattrs=None):
csrattrs=None, password_id=None):
cmd = "DPP_AUTH_INIT"
if peer is None:
if nfc_uri:
@ -1618,6 +1618,8 @@ class WpaSupplicant:
cmd += " ssid_charset=%d" % ssid_charset
if passphrase:
cmd += " pass=" + binascii.hexlify(passphrase.encode()).decode()
if password_id:
cmd += " idpass=" + binascii.hexlify(password_id.encode()).decode()
if tcp_addr:
cmd += " tcp_addr=" + tcp_addr
if tcp_port: