aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-01-01 15:14:46 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-01 15:22:21 (GMT)
commit656f11c73230a352ad3d71dbe8437f05d97bd797 (patch)
tree113c9774eee776f6ae3f776267eb4993914312ed /tests
parent4f6cd3f4262467d2d736f72fbf163e6338dda064 (diff)
downloadhostap-656f11c73230a352ad3d71dbe8437f05d97bd797.zip
hostap-656f11c73230a352ad3d71dbe8437f05d97bd797.tar.gz
hostap-656f11c73230a352ad3d71dbe8437f05d97bd797.tar.bz2
tests: wpa_supplicant AP mode - unexpected P2P IE in Association Request
This verifies that there is no NULL pointer dereference when the AP code processes Probe Request and (Re)Association Request frames with a P2P IE in case P2P support is explicitly disabled on the AP mode interface. This is a regression test case for the fixes in the previous commit. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_wpas_ap.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py
index 6d4a3c5..43a460c 100644
--- a/tests/hwsim/test_wpas_ap.py
+++ b/tests/hwsim/test_wpas_ap.py
@@ -357,3 +357,30 @@ def test_wpas_ap_acs(dev):
raise Exception("Unexpected operating channel selected")
dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq=freq)
+
+def test_wpas_ap_and_assoc_req_p2p_ie(dev):
+ """wpa_supplicant AP mode - unexpected P2P IE in Association Request"""
+ try:
+ _test_wpas_ap_and_assoc_req_p2p_ie(dev)
+ finally:
+ dev[1].request("VENDOR_ELEM_REMOVE 13 *")
+ dev[0].request("P2P_SET disabled 0")
+
+def _test_wpas_ap_and_assoc_req_p2p_ie(dev):
+ dev[0].request("P2P_SET disabled 1")
+ id = dev[0].add_network()
+ dev[0].set_network(id, "mode", "2")
+ dev[0].set_network_quoted(id, "ssid", "wpas-ap-open")
+ dev[0].set_network(id, "key_mgmt", "NONE")
+ dev[0].set_network(id, "frequency", "2412")
+ dev[0].set_network(id, "scan_freq", "2412")
+ dev[0].select_network(id)
+ wait_ap_ready(dev[0])
+
+ dev[1].request("VENDOR_ELEM_ADD 13 dd04506f9a09")
+ dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq="2412")
+ dev[1].request("DISCONNECT")
+ dev[1].wait_disconnected()
+
+ dev[0].request("DISCONNECT")
+ dev[0].wait_disconnected()