From 7b7328e3cd169f5ba110d045b33455f7b3192e25 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 5 Apr 2014 17:52:44 +0300 Subject: [PATCH] tests: PeerKey failure due to mismatching cipher Signed-off-by: Jouni Malinen --- tests/hwsim/test_peerkey.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/hwsim/test_peerkey.py b/tests/hwsim/test_peerkey.py index 6234a700b..36e5eabfb 100644 --- a/tests/hwsim/test_peerkey.py +++ b/tests/hwsim/test_peerkey.py @@ -10,6 +10,7 @@ import time import hwsim_utils import hostapd +from wlantest import Wlantest def test_peerkey(dev, apdev): """RSN AP and PeerKey between two STAs""" @@ -44,3 +45,26 @@ def test_peerkey_unknown_peer(dev, apdev): dev[0].request("STKSTART " + dev[2].p2p_interface_addr()) time.sleep(0.5) + +def test_peerkey_pairwise_mismatch(dev, apdev): + """RSN TKIP+CCMP AP and PeerKey between two STAs using different ciphers""" + wt = Wlantest() + wt.flush() + wt.add_passphrase("12345678") + ssid = "test-peerkey" + passphrase = "12345678" + params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) + params['peerkey'] = "1" + params['rsn_pairwise'] = "TKIP CCMP" + hostapd.add_ap(apdev[0]['ifname'], params) + + dev[0].connect(ssid, psk=passphrase, scan_freq="2412", peerkey=True, + pairwise="CCMP") + dev[1].connect(ssid, psk=passphrase, scan_freq="2412", peerkey=True, + pairwise="TKIP") + hwsim_utils.test_connectivity_sta(dev[0], dev[1]) + + dev[0].request("STKSTART " + dev[1].p2p_interface_addr()) + time.sleep(0.5) + dev[1].request("STKSTART " + dev[0].p2p_interface_addr()) + time.sleep(0.5)