From cc15799f6d9515070e949b906d5af9ad097719b4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 27 Dec 2017 18:39:20 +0200 Subject: [PATCH] tests: Mixed mode BSS and MFP-enabled AP rejecting TKIP Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_pmf.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/hwsim/test_ap_pmf.py b/tests/hwsim/test_ap_pmf.py index 16956cdee..c60f66d4d 100644 --- a/tests/hwsim/test_ap_pmf.py +++ b/tests/hwsim/test_ap_pmf.py @@ -500,3 +500,33 @@ def test_ap_pmf_inject_auth(dev, apdev): # Verify that original association is still functional. hwsim_utils.test_connectivity(dev[0], hapd) + +def test_ap_pmf_tkip_reject(dev, apdev): + """Mixed mode BSS and MFP-enabled AP rejecting TKIP""" + params = hostapd.wpa2_params(ssid="test-pmf", passphrase="12345678") + params['wpa'] = '3' + params["ieee80211w"] = "1" + params["wpa_pairwise"] = "TKIP CCMP" + params["rsn_pairwise"] = "TKIP CCMP" + hostapd.add_ap(apdev[0], params) + + dev[0].connect("test-pmf", psk="12345678", pairwise="CCMP", ieee80211w="2", + scan_freq="2412") + dev[0].dump_monitor() + + dev[1].connect("test-pmf", psk="12345678", proto="WPA", pairwise="TKIP", + ieee80211w="0", scan_freq="2412") + dev[1].dump_monitor() + + dev[2].connect("test-pmf", psk="12345678", pairwise="TKIP", + ieee80211w="2", scan_freq="2412", wait_connect=False) + ev = dev[2].wait_event(["CTRL-EVENT-CONNECTED", + "CTRL-EVENT-ASSOC-REJECT"], timeout=10) + if ev is None: + raise Exception("No connection result reported") + if "CTRL-EVENT-ASSOC-REJECT" not in ev: + raise Exception("MFP + TKIP connection was not rejected") + if "status_code=31" not in ev: + raise Exception("Unexpected status code in rejection: " + ev) + dev[2].request("DISCONNECT") + dev[2].dump_monitor()