]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: SAE and password identifier with FFC
authorJouni Malinen <j@w1.fi>
Sun, 2 Dec 2018 09:56:04 +0000 (11:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Dec 2018 09:56:04 +0000 (11:56 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_sae.py

index b31046df014d365023a85e28be7af386e9647ea8..2a2b887a47434dc0b56c711ea926179cf8304c5c 100644 (file)
@@ -1273,18 +1273,21 @@ def test_sae_connect_cmd(dev, apdev):
     if ev is None:
         raise Exception("No connection result reported")
 
-def test_sae_password_id(dev, apdev):
-    """SAE and password identifier"""
+def run_sae_password_id(dev, apdev, groups=None):
     if "SAE" not in dev[0].get_capability("auth_alg"):
         raise HwsimSkip("SAE not supported")
     params = hostapd.wpa2_params(ssid="test-sae")
     params['wpa_key_mgmt'] = 'SAE'
+    if groups:
+        params['sae_groups'] = groups
+    else:
+        groups = ""
     params['sae_password'] = [ 'secret|mac=ff:ff:ff:ff:ff:ff|id=pw id',
                                'foo|mac=02:02:02:02:02:02',
                                'another secret|mac=ff:ff:ff:ff:ff:ff|id=' + 29*'A' ]
     hapd = hostapd.add_ap(apdev[0], params)
 
-    dev[0].request("SET sae_groups ")
+    dev[0].request("SET sae_groups " + groups)
     dev[0].connect("test-sae", sae_password="secret", sae_password_id="pw id",
                    key_mgmt="SAE", scan_freq="2412")
     dev[0].request("REMOVE_NETWORK all")
@@ -1307,6 +1310,18 @@ def test_sae_password_id(dev, apdev):
         raise Exception("Unknown password identifier not reported")
     dev[0].request("REMOVE_NETWORK all")
 
+def test_sae_password_id(dev, apdev):
+    """SAE and password identifier"""
+    run_sae_password_id(dev, apdev, "")
+
+def test_sae_password_id_ecc(dev, apdev):
+    """SAE and password identifier (ECC)"""
+    run_sae_password_id(dev, apdev, "19")
+
+def test_sae_password_id_ffc(dev, apdev):
+    """SAE and password identifier (FFC)"""
+    run_sae_password_id(dev, apdev, "22")
+
 def test_sae_forced_anti_clogging_pw_id(dev, apdev):
     """SAE anti clogging (forced and Password Identifier)"""
     if "SAE" not in dev[0].get_capability("auth_alg"):