tests: Verify TDLS responder teardown in encrypted network

Older mac80211 implementations did not set the link identifier
appropriately, resulting in an incorrect teardown packet being sent the
peer. wpa_supplicant adds the FTE containing the MIC field calculated
using the correct link-identifier. This causes a MIC failure on the
other side and the teardown is discarded. Verify this case is fixed by
newer kernel and wpa_supplicant code.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
This commit is contained in:
Arik Nemtsov 2014-09-29 20:47:54 +02:00 committed by Jouni Malinen
parent 08d7665c6b
commit 77835ae9dd

View file

@ -129,13 +129,16 @@ def setup_tdls(sta0, sta1, ap, reverse=False, expect_fail=False, allow_skip=Fals
tdls_check_dl(sta0, sta1, bssid, addr0, addr1) tdls_check_dl(sta0, sta1, bssid, addr0, addr1)
check_connectivity(sta0, sta1, ap) check_connectivity(sta0, sta1, ap)
def teardown_tdls(sta0, sta1, ap): def teardown_tdls(sta0, sta1, ap, responder=False):
logger.info("Teardown TDLS") logger.info("Teardown TDLS")
check_connectivity(sta0, sta1, ap) check_connectivity(sta0, sta1, ap)
bssid = ap['bssid'] bssid = ap['bssid']
addr0 = sta0.p2p_interface_addr() addr0 = sta0.p2p_interface_addr()
addr1 = sta1.p2p_interface_addr() addr1 = sta1.p2p_interface_addr()
sta0.tdls_teardown(addr1) if responder:
sta1.tdls_teardown(addr0)
else:
sta0.tdls_teardown(addr1)
time.sleep(1) time.sleep(1)
wt = Wlantest() wt = Wlantest()
teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1); teardown = wt.get_tdls_counter("teardown", bssid, addr0, addr1);
@ -319,3 +322,11 @@ def test_ap_wpa2_tdls_bssid_mismatch(dev, apdev):
finally: finally:
subprocess.call(['sudo', 'ip', 'link', 'set', 'dev', 'ap-br0', 'down']) subprocess.call(['sudo', 'ip', 'link', 'set', 'dev', 'ap-br0', 'down'])
subprocess.call(['sudo', 'brctl', 'delbr', 'ap-br0']) subprocess.call(['sudo', 'brctl', 'delbr', 'ap-br0'])
def test_ap_wpa2_tdls_responder_teardown(dev, apdev):
"""TDLS teardown from responder with WPA2-PSK AP"""
start_ap_wpa2_psk(apdev[0]['ifname'])
wlantest_setup()
connect_2sta_wpa2_psk(dev, apdev[0]['ifname'])
setup_tdls(dev[0], dev[1], apdev[0])
teardown_tdls(dev[0], dev[1], apdev[0], responder=True)