aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-11-28 13:23:09 (GMT)
committerJouni Malinen <j@w1.fi>2019-11-28 14:39:09 (GMT)
commitca6a2ac705b3c7ac2d8d0051f032701b296b0c57 (patch)
treeca25f03e1307722702a6a0e54b450a66e8a7953a
parent181bf93363c46398b413960f8fdf99796255ec8a (diff)
downloadhostap-ca6a2ac705b3c7ac2d8d0051f032701b296b0c57.zip
hostap-ca6a2ac705b3c7ac2d8d0051f032701b296b0c57.tar.gz
hostap-ca6a2ac705b3c7ac2d8d0051f032701b296b0c57.tar.bz2
tests: DPP ssid_charset/ssid64
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--tests/hwsim/test_dpp.py16
-rw-r--r--tests/hwsim/wpasupplicant.py5
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py
index 12156cd..e1b25d5 100644
--- a/tests/hwsim/test_dpp.py
+++ b/tests/hwsim/test_dpp.py
@@ -1776,6 +1776,13 @@ def test_dpp_auto_connect_legacy(dev, apdev):
finally:
dev[0].set("dpp_config_processing", "0")
+def test_dpp_auto_connect_legacy_ssid_charset(dev, apdev):
+ """DPP and auto connect (legacy, ssid_charset)"""
+ try:
+ run_dpp_auto_connect_legacy(dev, apdev, ssid_charset=12345)
+ finally:
+ dev[0].set("dpp_config_processing", "0")
+
def test_dpp_auto_connect_legacy_sae_1(dev, apdev):
"""DPP and auto connect (legacy SAE)"""
try:
@@ -1814,6 +1821,7 @@ def test_dpp_auto_connect_legacy_psk_sae_3(dev, apdev):
dev[0].set("dpp_config_processing", "0")
def run_dpp_auto_connect_legacy(dev, apdev, conf='sta-psk',
+ ssid_charset=None,
psk_sae=False, sae_only=False):
check_dpp_capab(dev[0])
check_dpp_capab(dev[1])
@@ -1837,8 +1845,16 @@ 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="secret passphrase")
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)
+ if ev is None:
+ raise Exception("ssid_charset not reported")
+ charset = ev.split(' ')[1]
+ if charset != str(ssid_charset):
+ raise Exception("Incorrect ssid_charset reported: " + ev)
ev = dev[0].wait_event(["DPP-NETWORK-ID"], timeout=1)
if ev is None:
raise Exception("DPP network profile not generated")
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index 5549b7b..26315fc 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -1458,7 +1458,8 @@ class WpaSupplicant:
def dpp_auth_init(self, peer=None, uri=None, conf=None, configurator=None,
extra=None, own=None, role=None, neg_freq=None,
ssid=None, passphrase=None, expect_fail=False,
- tcp_addr=None, tcp_port=None, conn_status=False):
+ tcp_addr=None, tcp_port=None, conn_status=False,
+ ssid_charset=None):
cmd = "DPP_AUTH_INIT"
if peer is None:
peer = self.dpp_qr_code(uri)
@@ -1477,6 +1478,8 @@ class WpaSupplicant:
cmd += " neg_freq=%d" % neg_freq
if ssid:
cmd += " ssid=" + binascii.hexlify(ssid.encode()).decode()
+ if ssid_charset:
+ cmd += " ssid_charset=%d" % ssid_charset
if passphrase:
cmd += " pass=" + binascii.hexlify(passphrase.encode()).decode()
if tcp_addr: