Skip to contentSkip to conversation

hwsim: add additional ciphers to disable list

PATCH In review James Prestwood 2 participants 3 messages Oct 26, 2022 – Oct 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 hwsim: add additional ciphers to disable list

Allows these ciphers to be disabled when creating radios.

---
 tools/hwsim.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tools/hwsim.c +7 -1
index 75f074ab..0ace4c0e 100644
@@ -196,7 +196,13 @@ static const struct hwsim_support cipher_map[] = {
 	{ "wep104", CRYPTO_CIPHER_WEP104 },
 	{ "tkip", CRYPTO_CIPHER_TKIP },
 	{ "ccmp", CRYPTO_CIPHER_CCMP },
-	{ "bip", CRYPTO_CIPHER_BIP_CMAC },
+	{ "bip_cmac", CRYPTO_CIPHER_BIP_CMAC },
+	{ "gcmp", CRYPTO_CIPHER_GCMP },
+	{ "gcmp_256", CRYPTO_CIPHER_GCMP_256 },
+	{ "ccmp_256", CRYPTO_CIPHER_CCMP_256 },
+	{ "bip_gmac", CRYPTO_CIPHER_BIP_GMAC },
+	{ "bip_gmac_256", CRYPTO_CIPHER_BIP_GMAC_256 },
+	{ "bip_cmac_256", CRYPTO_CIPHER_BIP_CMAC_256 },
 	{ }
 };
 
Signature · 1 line
2.34.3
#1 lore raw

PATCH 2/2 auto-t: test AP mode using TKIP

This limits all supported ciphers to TKIP and verifies the AP starts and can authenticate clients.

---
 .../testAP-no-support/connection_test.py      | 31 +++++++++++++++++--
 autotests/testAP-no-support/hw.conf           |  7 +++--
 2 files changed, 33 insertions(+), 5 deletions(-)
autotests/testAP-no-support/connection_test.py +28 -3
index 1bbc0bde..9e5dccbb 100644
@@ -5,17 +5,42 @@ import sys
 
 sys.path.append('../util')
 import iwd
-from iwd import IWD
+from iwd import IWD, NetworkType, PSKAgent
 
 class Test(unittest.TestCase):
-    def test_connection_success(self):
-        wd = IWD()
+    def test_no_ap_mode(self):
+        wd = IWD(True)
 
         dev = wd.list_devices(1)[0]
 
         with self.assertRaises(iwd.NotSupportedEx):
             dev.start_ap('TestAP2', 'Password2')
 
+    def test_only_tkip_support(self):
+        wd = IWD(True)
+
+        devices = wd.list_devices(2)
+
+        dev_sta = devices[0]
+        dev_ap = devices[1]
+
+        dev_ap.start_ap('TestAP2', 'Password2')
+
+        ordered_network = dev_sta.get_ordered_network('TestAP2')
+
+        if ordered_network.type != NetworkType.psk:
+            raise Exception("Network type mismatch")
+
+        psk_agent = PSKAgent('Password2')
+        wd.register_psk_agent(psk_agent)
+
+        ordered_network.network_object.connect()
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(dev_sta, condition)
+
+        wd.unregister_psk_agent(psk_agent)
+
     @classmethod
     def setUpClass(cls):
         pass
autotests/testAP-no-support/hw.conf +5 -2
index 9df3b349..06a9d7c2 100644
@@ -1,6 +1,9 @@
 [SETUP]
-num_radios=1
-radio_confs=rad0
+num_radios=2
+start_iwd=0
 
 [rad0]
 iftype_disable=ap
+
+[rad1]
+cipher_disable=ccmp,bip_cmac,gcmp,gcmp_256,ccmp_256,bip_gmac.bip_gmac_256,bip_cmac_256
Signature · 1 line
2.34.3
#2 lore raw
In reply to James Prestwood

Hi James,

Quoted 5 lines · James Prestwood

Allows these ciphers to be disabled when creating radios.

---
  tools/hwsim.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis