2 # Copyright (c) 2014, Jouni Malinen <j@w1.fi>
4 # This software may be distributed under the terms of the BSD license.
5 # See README for more details.
10 def test_wep_open_auth(dev, apdev):
11 """WEP Open System authentication"""
12 hostapd.add_ap(apdev[0]['ifname'],
14 "wep_key0": '"hello"' })
15 dev[0].connect("wep-open", key_mgmt="NONE", wep_key0='"hello"',
17 hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
19 def test_wep_shared_key_auth(dev, apdev):
20 """WEP Shared Key authentication"""
21 hostapd.add_ap(apdev[0]['ifname'],
22 { "ssid": "wep-shared-key",
23 "wep_key0": '"hello12345678"',
25 dev[0].connect("wep-shared-key", key_mgmt="NONE", auth_alg="SHARED",
26 wep_key0='"hello12345678"',
28 hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
29 dev[1].connect("wep-shared-key", key_mgmt="NONE", auth_alg="OPEN SHARED",
30 wep_key0='"hello12345678"',
33 def test_wep_shared_key_auth_not_allowed(dev, apdev):
34 """WEP Shared Key authentication not allowed"""
35 hostapd.add_ap(apdev[0]['ifname'],
36 { "ssid": "wep-shared-key",
37 "wep_key0": '"hello12345678"',
39 dev[0].connect("wep-shared-key", key_mgmt="NONE", auth_alg="SHARED",
40 wep_key0='"hello12345678"',
41 scan_freq="2412", wait_connect=False)
42 ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
44 raise Exception("Unexpected association")