From 0dc3c5f2ee2731bc620e956a173f767c55fde137 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 4 Feb 2018 12:40:03 +0200 Subject: [PATCH] tests: WPA2-PSK-FT AP with PSK from a file Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_ft.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 83ce7c311..63bcaf8f8 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -2022,3 +2022,34 @@ def test_ap_ft_reassoc_replay(dev, apdev, params): if not ok: raise Exception("The second hwsim connectivity test failed") + +def test_ap_ft_psk_file(dev, apdev): + """WPA2-PSK-FT AP with PSK from a file""" + ssid = "test-ft" + passphrase="12345678" + + params = ft_params1a(ssid=ssid, passphrase=passphrase) + params['wpa_psk_file'] = 'hostapd.wpa_psk' + hapd = hostapd.add_ap(apdev[0], params) + + dev[1].connect(ssid, psk="very secret", + key_mgmt="FT-PSK", proto="WPA2", ieee80211w="1", + scan_freq="2412", wait_connect=False) + dev[0].connect(ssid, psk=passphrase, key_mgmt="FT-PSK", proto="WPA2", + ieee80211w="1", scan_freq="2412") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + dev[0].connect(ssid, psk="very secret", key_mgmt="FT-PSK", proto="WPA2", + ieee80211w="1", scan_freq="2412") + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + dev[0].connect(ssid, psk="secret passphrase", + key_mgmt="FT-PSK", proto="WPA2", ieee80211w="1", + scan_freq="2412") + dev[2].connect(ssid, psk="another passphrase for all STAs", + key_mgmt="FT-PSK", proto="WPA2", ieee80211w="1", + scan_freq="2412") + ev = dev[1].wait_event(["WPA: 4-Way Handshake failed"], timeout=10) + if ev is None: + raise Exception("Timed out while waiting for failure report") + dev[1].request("REMOVE_NETWORK all")