tests: PeerKey failure due to mismatching cipher

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-04-05 17:52:44 +03:00
parent ca4fd18290
commit 7b7328e3cd

View 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)