]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: FST protocol tests to verify invalid STIE header
authorJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 07:56:02 +0000 (10:56 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 08:22:21 +0000 (11:22 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_fst_module.py

index 79617e22275077d35686669519ccdcd98a3fdd6c..47f824d31ecef03734cce9a197b7ac95f5728de1 100644 (file)
@@ -1839,6 +1839,18 @@ def test_fst_proto(dev, apdev, test_params):
                                      FST_ACTION_SETUP_REQUEST)
         hostapd_tx_and_status(hapd, msg)
 
+        # FST Request dropped: invalid STIE (EID)
+        msg['payload'] = struct.pack("<BBBLBBLBBBBBBB", ACTION_CATEG_FST,
+                                     FST_ACTION_SETUP_REQUEST, 0, 0,
+                                     163, 11, 0, 0, 0, 0, 0, 0, 0, 0)
+        hostapd_tx_and_status(hapd, msg)
+
+        # FST Request dropped: invalid STIE (Len)
+        msg['payload'] = struct.pack("<BBBLBBLBBBBBBB", ACTION_CATEG_FST,
+                                     FST_ACTION_SETUP_REQUEST, 0, 0,
+                                     164, 10, 0, 0, 0, 0, 0, 0, 0, 0)
+        hostapd_tx_and_status(hapd, msg)
+
         # FST Request dropped: new and old band IDs are the same
         msg['payload'] = struct.pack("<BBBLBBLBBBBBBB", ACTION_CATEG_FST,
                                      FST_ACTION_SETUP_REQUEST, 0, 0,
@@ -1969,6 +1981,26 @@ def test_fst_setup_response_proto(dev, apdev, test_params):
                                      FST_ACTION_SETUP_RESPONSE)
         hostapd_tx_and_status(hapd, msg)
 
+        # FST Response dropped: invalid STIE (EID)
+        dialog_token = 1
+        status_code = 0
+        id = 0
+        msg['payload'] = struct.pack("<BBBBBBLBBBBBBB", ACTION_CATEG_FST,
+                                     FST_ACTION_SETUP_RESPONSE, dialog_token,
+                                     status_code,
+                                     163, 11, 0, 0, id, 0, 0, 0, 0, 0)
+        hostapd_tx_and_status(hapd, msg)
+
+        # FST Response dropped: invalid STIE (Len)
+        dialog_token = 1
+        status_code = 0
+        id = 0
+        msg['payload'] = struct.pack("<BBBBBBLBBBBBBB", ACTION_CATEG_FST,
+                                     FST_ACTION_SETUP_RESPONSE, dialog_token,
+                                     status_code,
+                                     164, 10, 0, 0, id, 0, 0, 0, 0, 0)
+        hostapd_tx_and_status(hapd, msg)
+
         # FST Response dropped due to wrong dialog token
         dialog_token = 123
         status_code = 0