tests: WEP with non-zero key index
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 19 Nov 2014 15:37:54 +0000 (17:37 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 19 Nov 2014 15:37:54 +0000 (17:37 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_wep.py
tests/hwsim/wpasupplicant.py

index 725e565..7f3a941 100644 (file)
@@ -44,3 +44,34 @@ def test_wep_shared_key_auth_not_allowed(dev, apdev):
     ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
     if ev is not None:
         raise Exception("Unexpected association")
+
+def test_wep_shared_key_auth_multi_key(dev, apdev):
+    """WEP Shared Key authentication with multiple keys"""
+    hapd = hostapd.add_ap(apdev[0]['ifname'],
+                          { "ssid": "wep-shared-key",
+                            "wep_key0": '"hello12345678"',
+                            "wep_key1": '"other12345678"',
+                            "auth_algs": "2" })
+    dev[0].connect("wep-shared-key", key_mgmt="NONE", auth_alg="SHARED",
+                   wep_key0='"hello12345678"',
+                   scan_freq="2412")
+    dev[1].connect("wep-shared-key", key_mgmt="NONE", auth_alg="SHARED",
+                   wep_key0='"hello12345678"',
+                   wep_key1='"other12345678"',
+                   wep_tx_keyidx="1",
+                   scan_freq="2412")
+    id = dev[2].connect("wep-shared-key", key_mgmt="NONE", auth_alg="SHARED",
+                        wep_key0='"hello12345678"',
+                        wep_key1='"other12345678"',
+                        wep_tx_keyidx="0",
+                        scan_freq="2412")
+    hwsim_utils.test_connectivity(dev[0], hapd)
+    hwsim_utils.test_connectivity(dev[1], hapd)
+    hwsim_utils.test_connectivity(dev[2], hapd)
+
+    dev[2].set_network(id, "wep_tx_keyidx", "1")
+    dev[2].request("REASSOCIATE")
+    ev = dev[2].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10)
+    if ev is None:
+        raise Exception("Reassociation with the AP timed out")
+    hwsim_utils.test_connectivity(dev[2], hapd)
index 8354da5..fbf44d1 100644 (file)
@@ -750,7 +750,8 @@ class WpaSupplicant:
                 self.set_network_quoted(id, field, kwargs[field])
 
         not_quoted = [ "proto", "key_mgmt", "ieee80211w", "pairwise",
-                       "group", "wep_key0", "scan_freq", "eap",
+                       "group", "wep_key0", "wep_key1", "wep_key2", "wep_key3",
+                       "wep_tx_keyidx", "scan_freq", "eap",
                        "eapol_flags", "fragment_size", "scan_ssid", "auth_alg",
                        "wpa_ptk_rekey", "disable_ht", "disable_vht", "bssid",
                        "disable_max_amsdu", "ampdu_factor", "ampdu_density",