test_ieee8021x.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. # IEEE 802.1X tests
  2. # Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. from remotehost import remote_compatible
  7. import binascii
  8. import hmac
  9. import logging
  10. import os
  11. import time
  12. import hostapd
  13. import hwsim_utils
  14. from utils import skip_with_fips
  15. from tshark import run_tshark
  16. logger = logging.getLogger()
  17. def test_ieee8021x_wep104(dev, apdev):
  18. """IEEE 802.1X connection using dynamic WEP104"""
  19. skip_with_fips(dev[0])
  20. params = hostapd.radius_params()
  21. params["ssid"] = "ieee8021x-wep"
  22. params["ieee8021x"] = "1"
  23. params["wep_key_len_broadcast"] = "13"
  24. params["wep_key_len_unicast"] = "13"
  25. hapd = hostapd.add_ap(apdev[0], params)
  26. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X", eap="PSK",
  27. identity="psk.user@example.com",
  28. password_hex="0123456789abcdef0123456789abcdef",
  29. scan_freq="2412")
  30. hwsim_utils.test_connectivity(dev[0], hapd)
  31. def test_ieee8021x_wep40(dev, apdev):
  32. """IEEE 802.1X connection using dynamic WEP40"""
  33. skip_with_fips(dev[0])
  34. params = hostapd.radius_params()
  35. params["ssid"] = "ieee8021x-wep"
  36. params["ieee8021x"] = "1"
  37. params["wep_key_len_broadcast"] = "5"
  38. params["wep_key_len_unicast"] = "5"
  39. hapd = hostapd.add_ap(apdev[0], params)
  40. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X", eap="PSK",
  41. identity="psk.user@example.com",
  42. password_hex="0123456789abcdef0123456789abcdef",
  43. scan_freq="2412")
  44. hwsim_utils.test_connectivity(dev[0], hapd)
  45. def test_ieee8021x_wep_index_workaround(dev, apdev):
  46. """IEEE 802.1X and EAPOL-Key index workaround"""
  47. skip_with_fips(dev[0])
  48. params = hostapd.radius_params()
  49. params["ssid"] = "ieee8021x-wep"
  50. params["ieee8021x"] = "1"
  51. params["wep_key_len_broadcast"] = "5"
  52. params["eapol_key_index_workaround"] = "1"
  53. hapd = hostapd.add_ap(apdev[0], params)
  54. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X", eapol_flags="1",
  55. eap="PSK",
  56. identity="psk.user@example.com",
  57. password_hex="0123456789abcdef0123456789abcdef",
  58. scan_freq="2412")
  59. def test_ieee8021x_open(dev, apdev):
  60. """IEEE 802.1X connection using open network"""
  61. params = hostapd.radius_params()
  62. params["ssid"] = "ieee8021x-open"
  63. params["ieee8021x"] = "1"
  64. hapd = hostapd.add_ap(apdev[0], params)
  65. id = dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  66. eap="PSK", identity="psk.user@example.com",
  67. password_hex="0123456789abcdef0123456789abcdef",
  68. scan_freq="2412")
  69. hwsim_utils.test_connectivity(dev[0], hapd)
  70. logger.info("Test EAPOL-Logoff")
  71. dev[0].request("LOGOFF")
  72. ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"])
  73. if ev is None:
  74. raise Exception("Did not get disconnected")
  75. if "reason=23" not in ev:
  76. raise Exception("Unexpected disconnection reason")
  77. dev[0].request("LOGON")
  78. dev[0].connect_network(id)
  79. hwsim_utils.test_connectivity(dev[0], hapd)
  80. def test_ieee8021x_static_wep40(dev, apdev):
  81. """IEEE 802.1X connection using static WEP40"""
  82. run_static_wep(dev, apdev, '"hello"')
  83. def test_ieee8021x_static_wep104(dev, apdev):
  84. """IEEE 802.1X connection using static WEP104"""
  85. run_static_wep(dev, apdev, '"hello-there-/"')
  86. def run_static_wep(dev, apdev, key):
  87. params = hostapd.radius_params()
  88. params["ssid"] = "ieee8021x-wep"
  89. params["ieee8021x"] = "1"
  90. params["wep_key0"] = key
  91. hapd = hostapd.add_ap(apdev[0], params)
  92. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X", eap="PSK",
  93. identity="psk.user@example.com",
  94. password_hex="0123456789abcdef0123456789abcdef",
  95. wep_key0=key, eapol_flags="0",
  96. scan_freq="2412")
  97. hwsim_utils.test_connectivity(dev[0], hapd)
  98. def test_ieee8021x_proto(dev, apdev):
  99. """IEEE 802.1X and EAPOL supplicant protocol testing"""
  100. params = hostapd.radius_params()
  101. params["ssid"] = "ieee8021x-open"
  102. params["ieee8021x"] = "1"
  103. hapd = hostapd.add_ap(apdev[0], params)
  104. bssid = apdev[0]['bssid']
  105. dev[1].request("SET ext_eapol_frame_io 1")
  106. dev[1].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  107. eap="PSK", identity="psk.user@example.com",
  108. password_hex="0123456789abcdef0123456789abcdef",
  109. scan_freq="2412", wait_connect=False)
  110. id = dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  111. eap="PSK", identity="psk.user@example.com",
  112. password_hex="0123456789abcdef0123456789abcdef",
  113. scan_freq="2412")
  114. ev = dev[1].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=5)
  115. start = dev[0].get_mib()
  116. tests = [ "11",
  117. "11223344",
  118. "020000050a93000501",
  119. "020300050a93000501",
  120. "0203002c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  121. "0203002c0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  122. "0203002c0100050000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  123. "02aa00050a93000501" ]
  124. for frame in tests:
  125. res = dev[0].request("EAPOL_RX " + bssid + " " + frame)
  126. if "OK" not in res:
  127. raise Exception("EAPOL_RX to wpa_supplicant failed")
  128. dev[1].request("EAPOL_RX " + bssid + " " + frame)
  129. stop = dev[0].get_mib()
  130. logger.info("MIB before test frames: " + str(start))
  131. logger.info("MIB after test frames: " + str(stop))
  132. vals = [ 'dot1xSuppInvalidEapolFramesRx',
  133. 'dot1xSuppEapLengthErrorFramesRx' ]
  134. for val in vals:
  135. if int(stop[val]) <= int(start[val]):
  136. raise Exception(val + " did not increase")
  137. @remote_compatible
  138. def test_ieee8021x_eapol_start(dev, apdev):
  139. """IEEE 802.1X and EAPOL-Start retransmissions"""
  140. params = hostapd.radius_params()
  141. params["ssid"] = "ieee8021x-open"
  142. params["ieee8021x"] = "1"
  143. hapd = hostapd.add_ap(apdev[0], params)
  144. bssid = apdev[0]['bssid']
  145. addr0 = dev[0].own_addr()
  146. hapd.set("ext_eapol_frame_io", "1")
  147. try:
  148. dev[0].request("SET EAPOL::startPeriod 1")
  149. dev[0].request("SET EAPOL::maxStart 1")
  150. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  151. eap="PSK", identity="psk.user@example.com",
  152. password_hex="0123456789abcdef0123456789abcdef",
  153. scan_freq="2412", wait_connect=False)
  154. held = False
  155. for i in range(30):
  156. pae = dev[0].get_status_field('Supplicant PAE state')
  157. if pae == "HELD":
  158. mib = hapd.get_sta(addr0, info="eapol")
  159. if mib['auth_pae_state'] != 'AUTHENTICATING':
  160. raise Exception("Unexpected Auth PAE state: " + mib['auth_pae_state'])
  161. held = True
  162. break
  163. time.sleep(0.25)
  164. if not held:
  165. raise Exception("PAE state HELD not reached")
  166. dev[0].wait_disconnected()
  167. finally:
  168. dev[0].request("SET EAPOL::startPeriod 30")
  169. dev[0].request("SET EAPOL::maxStart 3")
  170. def test_ieee8021x_held(dev, apdev):
  171. """IEEE 802.1X and HELD state"""
  172. params = hostapd.radius_params()
  173. params["ssid"] = "ieee8021x-open"
  174. params["ieee8021x"] = "1"
  175. hapd = hostapd.add_ap(apdev[0], params)
  176. bssid = apdev[0]['bssid']
  177. hapd.set("ext_eapol_frame_io", "1")
  178. try:
  179. dev[0].request("SET EAPOL::startPeriod 1")
  180. dev[0].request("SET EAPOL::maxStart 0")
  181. dev[0].request("SET EAPOL::heldPeriod 1")
  182. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  183. eap="PSK", identity="psk.user@example.com",
  184. password_hex="0123456789abcdef0123456789abcdef",
  185. scan_freq="2412", wait_connect=False)
  186. held = False
  187. for i in range(30):
  188. pae = dev[0].get_status_field('Supplicant PAE state')
  189. if pae == "HELD":
  190. held = True
  191. break
  192. time.sleep(0.25)
  193. if not held:
  194. raise Exception("PAE state HELD not reached")
  195. hapd.set("ext_eapol_frame_io", "0")
  196. for i in range(30):
  197. pae = dev[0].get_status_field('Supplicant PAE state')
  198. if pae != "HELD":
  199. held = False
  200. break
  201. time.sleep(0.25)
  202. if held:
  203. raise Exception("PAE state HELD not left")
  204. ev = dev[0].wait_event([ "CTRL-EVENT-CONNECTED",
  205. "CTRL-EVENT-DISCONNECTED" ], timeout=10)
  206. if ev is None:
  207. raise Exception("Connection timed out")
  208. if "CTRL-EVENT-DISCONNECTED" in ev:
  209. raise Exception("Unexpected disconnection")
  210. finally:
  211. dev[0].request("SET EAPOL::startPeriod 30")
  212. dev[0].request("SET EAPOL::maxStart 3")
  213. dev[0].request("SET EAPOL::heldPeriod 60")
  214. def send_eapol_key(dev, bssid, signkey, frame_start, frame_end):
  215. zero_sign = "00000000000000000000000000000000"
  216. frame = frame_start + zero_sign + frame_end
  217. hmac_obj = hmac.new(binascii.unhexlify(signkey))
  218. hmac_obj.update(binascii.unhexlify(frame))
  219. sign = hmac_obj.digest()
  220. frame = frame_start + binascii.hexlify(sign) + frame_end
  221. dev.request("EAPOL_RX " + bssid + " " + frame)
  222. def test_ieee8021x_eapol_key(dev, apdev):
  223. """IEEE 802.1X connection and EAPOL-Key protocol tests"""
  224. skip_with_fips(dev[0])
  225. params = hostapd.radius_params()
  226. params["ssid"] = "ieee8021x-wep"
  227. params["ieee8021x"] = "1"
  228. params["wep_key_len_broadcast"] = "5"
  229. params["wep_key_len_unicast"] = "5"
  230. hapd = hostapd.add_ap(apdev[0], params)
  231. bssid = apdev[0]['bssid']
  232. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X", eap="VENDOR-TEST",
  233. identity="vendor-test", scan_freq="2412")
  234. # Hardcoded MSK from VENDOR-TEST
  235. encrkey = "1111111111111111111111111111111111111111111111111111111111111111"
  236. signkey = "2222222222222222222222222222222222222222222222222222222222222222"
  237. # EAPOL-Key replay counter does not increase
  238. send_eapol_key(dev[0], bssid, signkey,
  239. "02030031" + "010005" + "0000000000000000" + "056c22d109f29d4d9fb9b9ccbad33283" + "02",
  240. "1c636a30a4")
  241. # EAPOL-Key too large Key Length field value
  242. send_eapol_key(dev[0], bssid, signkey,
  243. "02030031" + "010021" + "ffffffffffffffff" + "056c22d109f29d4d9fb9b9ccbad33283" + "02",
  244. "1c636a30a4")
  245. # EAPOL-Key too much key data
  246. send_eapol_key(dev[0], bssid, signkey,
  247. "0203004d" + "010005" + "ffffffffffffffff" + "056c22d109f29d4d9fb9b9ccbad33283" + "02",
  248. 33*"ff")
  249. # EAPOL-Key too little key data
  250. send_eapol_key(dev[0], bssid, signkey,
  251. "02030030" + "010005" + "ffffffffffffffff" + "056c22d109f29d4d9fb9b9ccbad33283" + "02",
  252. "1c636a30")
  253. # EAPOL-Key with no key data and too long WEP key length
  254. send_eapol_key(dev[0], bssid, signkey,
  255. "0203002c" + "010020" + "ffffffffffffffff" + "056c22d109f29d4d9fb9b9ccbad33283" + "02",
  256. "")
  257. def test_ieee8021x_reauth(dev, apdev):
  258. """IEEE 802.1X and EAPOL_REAUTH request"""
  259. params = hostapd.radius_params()
  260. params["ssid"] = "ieee8021x-open"
  261. params["ieee8021x"] = "1"
  262. hapd = hostapd.add_ap(apdev[0], params)
  263. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  264. eap="PSK", identity="psk.user@example.com",
  265. password_hex="0123456789abcdef0123456789abcdef",
  266. scan_freq="2412")
  267. hapd.request("EAPOL_REAUTH " + dev[0].own_addr())
  268. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=5)
  269. if ev is None:
  270. raise Exception("EAP authentication did not start")
  271. ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=5)
  272. if ev is None:
  273. raise Exception("EAP authentication did not succeed")
  274. time.sleep(0.1)
  275. hwsim_utils.test_connectivity(dev[0], hapd)
  276. def test_ieee8021x_reauth_wep(dev, apdev, params):
  277. """IEEE 802.1X and EAPOL_REAUTH request with WEP"""
  278. logdir = params['logdir']
  279. params = hostapd.radius_params()
  280. params["ssid"] = "ieee8021x-open"
  281. params["ieee8021x"] = "1"
  282. params["wep_key_len_broadcast"] = "13"
  283. params["wep_key_len_unicast"] = "13"
  284. hapd = hostapd.add_ap(apdev[0], params)
  285. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X",
  286. eap="PSK", identity="psk.user@example.com",
  287. password_hex="0123456789abcdef0123456789abcdef",
  288. scan_freq="2412")
  289. hwsim_utils.test_connectivity(dev[0], hapd)
  290. hapd.request("EAPOL_REAUTH " + dev[0].own_addr())
  291. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=5)
  292. if ev is None:
  293. raise Exception("EAP authentication did not start")
  294. ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=5)
  295. if ev is None:
  296. raise Exception("EAP authentication did not succeed")
  297. time.sleep(0.1)
  298. hwsim_utils.test_connectivity(dev[0], hapd)
  299. out = run_tshark(os.path.join(logdir, "hwsim0.pcapng"),
  300. "llc.type == 0x888e", ["eapol.type", "eap.code"])
  301. if out is None:
  302. raise Exception("Could not find EAPOL frames in capture")
  303. num_eapol_key = 0
  304. num_eap_req = 0
  305. num_eap_resp = 0
  306. for line in out.splitlines():
  307. vals = line.split()
  308. if vals[0] == '3':
  309. num_eapol_key += 1
  310. if vals[0] == '0' and len(vals) == 2:
  311. if vals[1] == '1':
  312. num_eap_req += 1
  313. elif vals[1] == '2':
  314. num_eap_resp += 1
  315. logger.info("num_eapol_key: %d" % num_eapol_key)
  316. logger.info("num_eap_req: %d" % num_eap_req)
  317. logger.info("num_eap_resp: %d" % num_eap_resp)
  318. if num_eapol_key < 4:
  319. raise Exception("Did not see four unencrypted EAPOL-Key frames")
  320. if num_eap_req < 6:
  321. raise Exception("Did not see six unencrypted EAP-Request frames")
  322. if num_eap_resp < 6:
  323. raise Exception("Did not see six unencrypted EAP-Response frames")
  324. def test_ieee8021x_set_conf(dev, apdev):
  325. """IEEE 802.1X and EAPOL_SET command"""
  326. params = hostapd.radius_params()
  327. params["ssid"] = "ieee8021x-open"
  328. params["ieee8021x"] = "1"
  329. hapd = hostapd.add_ap(apdev[0], params)
  330. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  331. eap="PSK", identity="psk.user@example.com",
  332. password_hex="0123456789abcdef0123456789abcdef",
  333. scan_freq="2412")
  334. addr0 = dev[0].own_addr()
  335. tests = [ "EAPOL_SET 1",
  336. "EAPOL_SET %sfoo bar" % addr0,
  337. "EAPOL_SET %s foo" % addr0,
  338. "EAPOL_SET %s foo bar" % addr0,
  339. "EAPOL_SET %s AdminControlledDirections bar" % addr0,
  340. "EAPOL_SET %s AdminControlledPortControl bar" % addr0,
  341. "EAPOL_SET %s reAuthEnabled bar" % addr0,
  342. "EAPOL_SET %s KeyTransmissionEnabled bar" % addr0,
  343. "EAPOL_SET 11:22:33:44:55:66 AdminControlledDirections Both" ]
  344. for t in tests:
  345. if "FAIL" not in hapd.request(t):
  346. raise Exception("Invalid EAPOL_SET command accepted: " + t)
  347. tests = [ ("AdminControlledDirections", "adminControlledDirections", "In"),
  348. ("AdminControlledDirections", "adminControlledDirections",
  349. "Both"),
  350. ("quietPeriod", "quietPeriod", "13"),
  351. ("serverTimeout", "serverTimeout", "7"),
  352. ("reAuthPeriod", "reAuthPeriod", "1234"),
  353. ("reAuthEnabled", "reAuthEnabled", "FALSE"),
  354. ("reAuthEnabled", "reAuthEnabled", "TRUE"),
  355. ("KeyTransmissionEnabled", "keyTxEnabled", "TRUE"),
  356. ("KeyTransmissionEnabled", "keyTxEnabled", "FALSE"),
  357. ("AdminControlledPortControl", "portControl", "ForceAuthorized"),
  358. ("AdminControlledPortControl", "portControl",
  359. "ForceUnauthorized"),
  360. ("AdminControlledPortControl", "portControl", "Auto") ]
  361. for param,mibparam,val in tests:
  362. if "OK" not in hapd.request("EAPOL_SET %s %s %s" % (addr0, param, val)):
  363. raise Exception("Failed to set %s %s" % (param, val))
  364. mib = hapd.get_sta(addr0, info="eapol")
  365. if mib[mibparam] != val:
  366. raise Exception("Unexpected %s value: %s (expected %s)" % (param, mib[mibparam], val))
  367. ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=5)
  368. if ev is None:
  369. raise Exception("EAP authentication did not succeed")
  370. time.sleep(0.1)
  371. hwsim_utils.test_connectivity(dev[0], hapd)
  372. def test_ieee8021x_auth_awhile(dev, apdev):
  373. """IEEE 802.1X and EAPOL Authenticator aWhile handling"""
  374. params = hostapd.radius_params()
  375. params["ssid"] = "ieee8021x-open"
  376. params["ieee8021x"] = "1"
  377. params['auth_server_port'] = "18129"
  378. hapd = hostapd.add_ap(apdev[0], params)
  379. bssid = apdev[0]['bssid']
  380. addr0 = dev[0].own_addr()
  381. params = {}
  382. params['ssid'] = 'as'
  383. params['beacon_int'] = '2000'
  384. params['radius_server_clients'] = 'auth_serv/radius_clients.conf'
  385. params['radius_server_auth_port'] = '18129'
  386. params['eap_server'] = '1'
  387. params['eap_user_file'] = 'auth_serv/eap_user.conf'
  388. params['ca_cert'] = 'auth_serv/ca.pem'
  389. params['server_cert'] = 'auth_serv/server.pem'
  390. params['private_key'] = 'auth_serv/server.key'
  391. hapd1 = hostapd.add_ap(apdev[1], params)
  392. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  393. eap="PSK", identity="psk.user@example.com",
  394. password_hex="0123456789abcdef0123456789abcdef",
  395. scan_freq="2412")
  396. hapd1.disable()
  397. if "OK" not in hapd.request("EAPOL_SET %s serverTimeout 1" % addr0):
  398. raise Exception("Failed to set serverTimeout")
  399. hapd.request("EAPOL_REAUTH " + dev[0].own_addr())
  400. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=5)
  401. for i in range(40):
  402. mib = hapd.get_sta(addr0, info="eapol")
  403. val = int(mib['aWhile'])
  404. if val > 0:
  405. break
  406. time.sleep(1)
  407. if val == 0:
  408. raise Exception("aWhile did not increase")
  409. hapd.dump_monitor()
  410. for i in range(40):
  411. mib = hapd.get_sta(addr0, info="eapol")
  412. val = int(mib['aWhile'])
  413. if val < 5:
  414. break
  415. time.sleep(1)
  416. ev = hapd.wait_event(["CTRL-EVENT-EAP-PROPOSED"], timeout=10)
  417. if ev is None:
  418. raise Exception("Authentication restart not seen")
  419. def test_ieee8021x_open_leap(dev, apdev):
  420. """IEEE 802.1X connection with LEAP included in configuration"""
  421. params = hostapd.radius_params()
  422. params["ssid"] = "ieee8021x-open"
  423. params["ieee8021x"] = "1"
  424. hapd = hostapd.add_ap(apdev[0], params)
  425. dev[1].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  426. eap="LEAP", identity="psk.user@example.com",
  427. password_hex="0123456789abcdef0123456789abcdef",
  428. scan_freq="2412", wait_connect=False)
  429. dev[0].connect("ieee8021x-open", key_mgmt="IEEE8021X", eapol_flags="0",
  430. eap="PSK LEAP", identity="psk.user@example.com",
  431. password_hex="0123456789abcdef0123456789abcdef",
  432. scan_freq="2412")
  433. ev = dev[1].wait_event(["CTRL-EVENT-AUTH-REJECT"], timeout=5)
  434. dev[1].request("DISCONNECT")
  435. def test_ieee8021x_and_wpa_enabled(dev, apdev):
  436. """IEEE 802.1X connection using dynamic WEP104 when WPA enabled"""
  437. skip_with_fips(dev[0])
  438. params = hostapd.radius_params()
  439. params["ssid"] = "ieee8021x-wep"
  440. params["ieee8021x"] = "1"
  441. params["wep_key_len_broadcast"] = "13"
  442. params["wep_key_len_unicast"] = "13"
  443. hapd = hostapd.add_ap(apdev[0], params)
  444. dev[0].connect("ieee8021x-wep", key_mgmt="IEEE8021X WPA-EAP", eap="PSK",
  445. identity="psk.user@example.com",
  446. password_hex="0123456789abcdef0123456789abcdef",
  447. scan_freq="2412")
  448. hwsim_utils.test_connectivity(dev[0], hapd)