tests: PeerKey failure due to mismatching cipher
authorJouni Malinen <j@w1.fi>
Sat, 5 Apr 2014 14:52:44 +0000 (17:52 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 5 Apr 2014 14:52:44 +0000 (17:52 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_peerkey.py

index 6234a70..36e5eab 100644 (file)
@@ -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)