tests: FST protocol tests to verify invalid STIE header

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-07-26 10:56:02 +03:00
parent b019955297
commit 6c247100e8

View 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