test_suite_b.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. # Suite B tests
  2. # Copyright (c) 2014-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. import time
  7. import logging
  8. logger = logging.getLogger()
  9. import hostapd
  10. from utils import HwsimSkip, fail_test
  11. def check_suite_b_capa(dev):
  12. if "GCMP" not in dev[0].get_capability("pairwise"):
  13. raise HwsimSkip("GCMP not supported")
  14. if "BIP-GMAC-128" not in dev[0].get_capability("group_mgmt"):
  15. raise HwsimSkip("BIP-GMAC-128 not supported")
  16. if "WPA-EAP-SUITE-B" not in dev[0].get_capability("key_mgmt"):
  17. raise HwsimSkip("WPA-EAP-SUITE-B not supported")
  18. check_suite_b_tls_lib(dev)
  19. def check_suite_b_tls_lib(dev):
  20. tls = dev[0].request("GET tls_library")
  21. if tls.startswith("GnuTLS"):
  22. return
  23. if not tls.startswith("OpenSSL"):
  24. raise HwsimSkip("TLS library not supported for Suite B: " + tls)
  25. supported = False
  26. for ver in [ '1.0.2', '1.1.0' ]:
  27. if "build=OpenSSL " + ver in tls and "run=OpenSSL " + ver in tls:
  28. supported = True
  29. break
  30. if not supported:
  31. raise HwsimSkip("OpenSSL version not supported for Suite B: " + tls)
  32. def suite_b_ap_params():
  33. params = { "ssid": "test-suite-b",
  34. "wpa": "2",
  35. "wpa_key_mgmt": "WPA-EAP-SUITE-B",
  36. "rsn_pairwise": "GCMP",
  37. "group_mgmt_cipher": "BIP-GMAC-128",
  38. "ieee80211w": "2",
  39. "ieee8021x": "1",
  40. "openssl_ciphers": "SUITEB128",
  41. #"dh_file": "auth_serv/dh.conf",
  42. "eap_server": "1",
  43. "eap_user_file": "auth_serv/eap_user.conf",
  44. "ca_cert": "auth_serv/ec-ca.pem",
  45. "server_cert": "auth_serv/ec-server.pem",
  46. "private_key": "auth_serv/ec-server.key" }
  47. return params
  48. def test_suite_b(dev, apdev):
  49. """WPA2/GCMP connection at Suite B 128-bit level"""
  50. check_suite_b_capa(dev)
  51. dev[0].flush_scan_cache()
  52. params = suite_b_ap_params()
  53. hapd = hostapd.add_ap(apdev[0], params)
  54. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B", ieee80211w="2",
  55. openssl_ciphers="SUITEB128",
  56. eap="TLS", identity="tls user",
  57. ca_cert="auth_serv/ec-ca.pem",
  58. client_cert="auth_serv/ec-user.pem",
  59. private_key="auth_serv/ec-user.key",
  60. pairwise="GCMP", group="GCMP", scan_freq="2412")
  61. tls_cipher = dev[0].get_status_field("EAP TLS cipher")
  62. if tls_cipher != "ECDHE-ECDSA-AES128-GCM-SHA256" and \
  63. tls_cipher != "ECDHE-ECDSA-AES-128-GCM-AEAD":
  64. raise Exception("Unexpected TLS cipher: " + tls_cipher)
  65. bss = dev[0].get_bss(apdev[0]['bssid'])
  66. if 'flags' not in bss:
  67. raise Exception("Could not get BSS flags from BSS table")
  68. if "[WPA2-EAP-SUITE-B-GCMP]" not in bss['flags']:
  69. raise Exception("Unexpected BSS flags: " + bss['flags'])
  70. dev[0].request("DISCONNECT")
  71. dev[0].wait_disconnected(timeout=20)
  72. dev[0].dump_monitor()
  73. dev[0].request("RECONNECT")
  74. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
  75. "CTRL-EVENT-CONNECTED"], timeout=20)
  76. if ev is None:
  77. raise Exception("Roaming with the AP timed out")
  78. if "CTRL-EVENT-EAP-STARTED" in ev:
  79. raise Exception("Unexpected EAP exchange")
  80. conf = hapd.get_config()
  81. if conf['key_mgmt'] != 'WPA-EAP-SUITE-B':
  82. raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
  83. def suite_b_as_params():
  84. params = {}
  85. params['ssid'] = 'as'
  86. params['beacon_int'] = '2000'
  87. params['radius_server_clients'] = 'auth_serv/radius_clients.conf'
  88. params['radius_server_auth_port'] = '18129'
  89. params['eap_server'] = '1'
  90. params['eap_user_file'] = 'auth_serv/eap_user.conf'
  91. params['ca_cert'] = 'auth_serv/ec-ca.pem'
  92. params['server_cert'] = 'auth_serv/ec-server.pem'
  93. params['private_key'] = 'auth_serv/ec-server.key'
  94. params['openssl_ciphers'] = 'SUITEB128'
  95. return params
  96. def test_suite_b_radius(dev, apdev):
  97. """WPA2/GCMP (RADIUS) connection at Suite B 128-bit level"""
  98. check_suite_b_capa(dev)
  99. dev[0].flush_scan_cache()
  100. params = suite_b_as_params()
  101. hostapd.add_ap(apdev[1], params)
  102. params = { "ssid": "test-suite-b",
  103. "wpa": "2",
  104. "wpa_key_mgmt": "WPA-EAP-SUITE-B",
  105. "rsn_pairwise": "GCMP",
  106. "group_mgmt_cipher": "BIP-GMAC-128",
  107. "ieee80211w": "2",
  108. "ieee8021x": "1",
  109. 'auth_server_addr': "127.0.0.1",
  110. 'auth_server_port': "18129",
  111. 'auth_server_shared_secret': "radius",
  112. 'nas_identifier': "nas.w1.fi" }
  113. hapd = hostapd.add_ap(apdev[0], params)
  114. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B", ieee80211w="2",
  115. openssl_ciphers="SUITEB128",
  116. eap="TLS", identity="tls user",
  117. ca_cert="auth_serv/ec-ca.pem",
  118. client_cert="auth_serv/ec-user.pem",
  119. private_key="auth_serv/ec-user.key",
  120. pairwise="GCMP", group="GCMP", scan_freq="2412")
  121. def check_suite_b_192_capa(dev):
  122. if "GCMP-256" not in dev[0].get_capability("pairwise"):
  123. raise HwsimSkip("GCMP-256 not supported")
  124. if "BIP-GMAC-256" not in dev[0].get_capability("group_mgmt"):
  125. raise HwsimSkip("BIP-GMAC-256 not supported")
  126. if "WPA-EAP-SUITE-B-192" not in dev[0].get_capability("key_mgmt"):
  127. raise HwsimSkip("WPA-EAP-SUITE-B-192 not supported")
  128. check_suite_b_tls_lib(dev)
  129. def suite_b_192_ap_params():
  130. params = { "ssid": "test-suite-b",
  131. "wpa": "2",
  132. "wpa_key_mgmt": "WPA-EAP-SUITE-B-192",
  133. "rsn_pairwise": "GCMP-256",
  134. "group_mgmt_cipher": "BIP-GMAC-256",
  135. "ieee80211w": "2",
  136. "ieee8021x": "1",
  137. "openssl_ciphers": "SUITEB192",
  138. "eap_server": "1",
  139. "eap_user_file": "auth_serv/eap_user.conf",
  140. "ca_cert": "auth_serv/ec2-ca.pem",
  141. "server_cert": "auth_serv/ec2-server.pem",
  142. "private_key": "auth_serv/ec2-server.key" }
  143. return params
  144. def test_suite_b_192(dev, apdev):
  145. """WPA2/GCMP-256 connection at Suite B 192-bit level"""
  146. check_suite_b_192_capa(dev)
  147. dev[0].flush_scan_cache()
  148. params = suite_b_192_ap_params()
  149. hapd = hostapd.add_ap(apdev[0], params)
  150. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  151. ieee80211w="2",
  152. openssl_ciphers="SUITEB192",
  153. eap="TLS", identity="tls user",
  154. ca_cert="auth_serv/ec2-ca.pem",
  155. client_cert="auth_serv/ec2-user.pem",
  156. private_key="auth_serv/ec2-user.key",
  157. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412")
  158. tls_cipher = dev[0].get_status_field("EAP TLS cipher")
  159. if tls_cipher != "ECDHE-ECDSA-AES256-GCM-SHA384" and \
  160. tls_cipher != "ECDHE-ECDSA-AES-256-GCM-AEAD":
  161. raise Exception("Unexpected TLS cipher: " + tls_cipher)
  162. cipher = dev[0].get_status_field("mgmt_group_cipher")
  163. if cipher != "BIP-GMAC-256":
  164. raise Exception("Unexpected mgmt_group_cipher: " + cipher)
  165. bss = dev[0].get_bss(apdev[0]['bssid'])
  166. if 'flags' not in bss:
  167. raise Exception("Could not get BSS flags from BSS table")
  168. if "[WPA2-EAP-SUITE-B-192-GCMP-256]" not in bss['flags']:
  169. raise Exception("Unexpected BSS flags: " + bss['flags'])
  170. dev[0].request("DISCONNECT")
  171. dev[0].wait_disconnected(timeout=20)
  172. dev[0].dump_monitor()
  173. dev[0].request("RECONNECT")
  174. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
  175. "CTRL-EVENT-CONNECTED"], timeout=20)
  176. if ev is None:
  177. raise Exception("Roaming with the AP timed out")
  178. if "CTRL-EVENT-EAP-STARTED" in ev:
  179. raise Exception("Unexpected EAP exchange")
  180. conf = hapd.get_config()
  181. if conf['key_mgmt'] != 'WPA-EAP-SUITE-B-192':
  182. raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
  183. def test_suite_b_192_radius(dev, apdev):
  184. """WPA2/GCMP-256 (RADIUS) connection at Suite B 192-bit level"""
  185. check_suite_b_192_capa(dev)
  186. dev[0].flush_scan_cache()
  187. params = suite_b_as_params()
  188. params['ca_cert'] = 'auth_serv/ec2-ca.pem'
  189. params['server_cert'] = 'auth_serv/ec2-server.pem'
  190. params['private_key'] = 'auth_serv/ec2-server.key'
  191. params['openssl_ciphers'] = 'SUITEB192'
  192. hostapd.add_ap(apdev[1], params)
  193. params = { "ssid": "test-suite-b",
  194. "wpa": "2",
  195. "wpa_key_mgmt": "WPA-EAP-SUITE-B-192",
  196. "rsn_pairwise": "GCMP-256",
  197. "group_mgmt_cipher": "BIP-GMAC-256",
  198. "ieee80211w": "2",
  199. "ieee8021x": "1",
  200. 'auth_server_addr': "127.0.0.1",
  201. 'auth_server_port': "18129",
  202. 'auth_server_shared_secret': "radius",
  203. 'nas_identifier': "nas.w1.fi" }
  204. hapd = hostapd.add_ap(apdev[0], params)
  205. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  206. ieee80211w="2",
  207. openssl_ciphers="SUITEB192",
  208. eap="TLS", identity="tls user",
  209. ca_cert="auth_serv/ec2-ca.pem",
  210. client_cert="auth_serv/ec2-user.pem",
  211. private_key="auth_serv/ec2-user.key",
  212. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412")
  213. def test_suite_b_pmkid_failure(dev, apdev):
  214. """WPA2/GCMP connection at Suite B 128-bit level and PMKID derivation failure"""
  215. check_suite_b_capa(dev)
  216. dev[0].flush_scan_cache()
  217. params = suite_b_ap_params()
  218. hapd = hostapd.add_ap(apdev[0], params)
  219. with fail_test(dev[0], 1, "rsn_pmkid_suite_b"):
  220. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B",
  221. ieee80211w="2",
  222. openssl_ciphers="SUITEB128",
  223. eap="TLS", identity="tls user",
  224. ca_cert="auth_serv/ec-ca.pem",
  225. client_cert="auth_serv/ec-user.pem",
  226. private_key="auth_serv/ec-user.key",
  227. pairwise="GCMP", group="GCMP", scan_freq="2412")
  228. def test_suite_b_192_pmkid_failure(dev, apdev):
  229. """WPA2/GCMP-256 connection at Suite B 192-bit level and PMKID derivation failure"""
  230. check_suite_b_192_capa(dev)
  231. dev[0].flush_scan_cache()
  232. params = suite_b_192_ap_params()
  233. hapd = hostapd.add_ap(apdev[0], params)
  234. with fail_test(dev[0], 1, "rsn_pmkid_suite_b"):
  235. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  236. ieee80211w="2",
  237. openssl_ciphers="SUITEB192",
  238. eap="TLS", identity="tls user",
  239. ca_cert="auth_serv/ec2-ca.pem",
  240. client_cert="auth_serv/ec2-user.pem",
  241. private_key="auth_serv/ec2-user.key",
  242. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412")
  243. def test_suite_b_mic_failure(dev, apdev):
  244. """WPA2/GCMP connection at Suite B 128-bit level and MIC derivation failure"""
  245. check_suite_b_capa(dev)
  246. dev[0].flush_scan_cache()
  247. params = suite_b_ap_params()
  248. hapd = hostapd.add_ap(apdev[0], params)
  249. with fail_test(dev[0], 1, "wpa_eapol_key_mic"):
  250. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B",
  251. ieee80211w="2",
  252. openssl_ciphers="SUITEB128",
  253. eap="TLS", identity="tls user",
  254. ca_cert="auth_serv/ec-ca.pem",
  255. client_cert="auth_serv/ec-user.pem",
  256. private_key="auth_serv/ec-user.key",
  257. pairwise="GCMP", group="GCMP", scan_freq="2412",
  258. wait_connect=False)
  259. dev[0].wait_disconnected()
  260. def test_suite_b_192_mic_failure(dev, apdev):
  261. """WPA2/GCMP connection at Suite B 192-bit level and MIC derivation failure"""
  262. check_suite_b_192_capa(dev)
  263. dev[0].flush_scan_cache()
  264. params = suite_b_192_ap_params()
  265. hapd = hostapd.add_ap(apdev[0], params)
  266. with fail_test(dev[0], 1, "wpa_eapol_key_mic"):
  267. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  268. ieee80211w="2",
  269. openssl_ciphers="SUITEB192",
  270. eap="TLS", identity="tls user",
  271. ca_cert="auth_serv/ec2-ca.pem",
  272. client_cert="auth_serv/ec2-user.pem",
  273. private_key="auth_serv/ec2-user.key",
  274. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412",
  275. wait_connect=False)
  276. dev[0].wait_disconnected()
  277. def suite_b_192_rsa_ap_params():
  278. params = { "ssid": "test-suite-b",
  279. "wpa": "2",
  280. "wpa_key_mgmt": "WPA-EAP-SUITE-B-192",
  281. "rsn_pairwise": "GCMP-256",
  282. "group_mgmt_cipher": "BIP-GMAC-256",
  283. "ieee80211w": "2",
  284. "ieee8021x": "1",
  285. "tls_flags": "[SUITEB]",
  286. "dh_file": "auth_serv/dh_param_3072.pem",
  287. "eap_server": "1",
  288. "eap_user_file": "auth_serv/eap_user.conf",
  289. "ca_cert": "auth_serv/rsa3072-ca.pem",
  290. "server_cert": "auth_serv/rsa3072-server.pem",
  291. "private_key": "auth_serv/rsa3072-server.key" }
  292. return params
  293. def test_suite_b_192_rsa(dev, apdev):
  294. """WPA2/GCMP-256 connection at Suite B 192-bit level and RSA"""
  295. run_suite_b_192_rsa(dev, apdev)
  296. def test_suite_b_192_rsa_ecdhe(dev, apdev):
  297. """WPA2/GCMP-256 connection at Suite B 192-bit level and RSA (ECDHE)"""
  298. run_suite_b_192_rsa(dev, apdev, no_dhe=True)
  299. def test_suite_b_192_rsa_dhe(dev, apdev):
  300. """WPA2/GCMP-256 connection at Suite B 192-bit level and RSA (DHE)"""
  301. run_suite_b_192_rsa(dev, apdev, no_ecdh=True)
  302. def run_suite_b_192_rsa(dev, apdev, no_ecdh=False, no_dhe=False):
  303. check_suite_b_192_capa(dev)
  304. dev[0].flush_scan_cache()
  305. params = suite_b_192_rsa_ap_params()
  306. if no_ecdh:
  307. params["tls_flags"] = "[SUITEB-NO-ECDH]"
  308. if no_dhe:
  309. del params["dh_file"]
  310. hapd = hostapd.add_ap(apdev[0], params)
  311. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  312. ieee80211w="2",
  313. phase1="tls_suiteb=1",
  314. eap="TLS", identity="tls user",
  315. ca_cert="auth_serv/rsa3072-ca.pem",
  316. client_cert="auth_serv/rsa3072-user.pem",
  317. private_key="auth_serv/rsa3072-user.key",
  318. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412")
  319. tls_cipher = dev[0].get_status_field("EAP TLS cipher")
  320. if tls_cipher != "ECDHE-RSA-AES256-GCM-SHA384" and \
  321. tls_cipher != "DHE-RSA-AES256-GCM-SHA384" and \
  322. tls_cipher != "ECDHE-RSA-AES-256-GCM-AEAD" and \
  323. tls_cipher != "DHE-RSA-AES-256-GCM-AEAD":
  324. raise Exception("Unexpected TLS cipher: " + tls_cipher)
  325. cipher = dev[0].get_status_field("mgmt_group_cipher")
  326. if cipher != "BIP-GMAC-256":
  327. raise Exception("Unexpected mgmt_group_cipher: " + cipher)
  328. bss = dev[0].get_bss(apdev[0]['bssid'])
  329. if 'flags' not in bss:
  330. raise Exception("Could not get BSS flags from BSS table")
  331. if "[WPA2-EAP-SUITE-B-192-GCMP-256]" not in bss['flags']:
  332. raise Exception("Unexpected BSS flags: " + bss['flags'])
  333. dev[0].request("DISCONNECT")
  334. dev[0].wait_disconnected(timeout=20)
  335. dev[0].dump_monitor()
  336. dev[0].request("RECONNECT")
  337. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
  338. "CTRL-EVENT-CONNECTED"], timeout=20)
  339. if ev is None:
  340. raise Exception("Roaming with the AP timed out")
  341. if "CTRL-EVENT-EAP-STARTED" in ev:
  342. raise Exception("Unexpected EAP exchange")
  343. conf = hapd.get_config()
  344. if conf['key_mgmt'] != 'WPA-EAP-SUITE-B-192':
  345. raise Exception("Unexpected config key_mgmt: " + conf['key_mgmt'])
  346. def test_suite_b_192_rsa_insufficient_key(dev, apdev):
  347. """WPA2/GCMP-256 connection at Suite B 192-bit level and RSA with insufficient key length"""
  348. check_suite_b_192_capa(dev)
  349. dev[0].flush_scan_cache()
  350. params = suite_b_192_rsa_ap_params()
  351. params["ca_cert"] = "auth_serv/ca.pem"
  352. params["server_cert"] = "auth_serv/server.pem"
  353. params["private_key"] = "auth_serv/server.key"
  354. hapd = hostapd.add_ap(apdev[0], params)
  355. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  356. ieee80211w="2",
  357. phase1="tls_suiteb=1",
  358. eap="TLS", identity="tls user",
  359. ca_cert="auth_serv/ca.pem",
  360. client_cert="auth_serv/user.pem",
  361. private_key="auth_serv/user.key",
  362. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412",
  363. wait_connect=False)
  364. ev = dev[0].wait_event(["CTRL-EVENT-EAP-TLS-CERT-ERROR"], timeout=10)
  365. dev[0].request("DISCONNECT")
  366. if ev is None:
  367. raise Exception("Certificate error not reported")
  368. if "reason=11" in ev and "err='Insufficient RSA modulus size'" in ev:
  369. return
  370. if "reason=7" in ev and "err='certificate uses insecure algorithm'" in ev:
  371. return
  372. raise Exception("Unexpected error reason: " + ev)
  373. def test_suite_b_192_rsa_insufficient_dh(dev, apdev):
  374. """WPA2/GCMP-256 connection at Suite B 192-bit level and RSA with insufficient DH key length"""
  375. check_suite_b_192_capa(dev)
  376. dev[0].flush_scan_cache()
  377. params = suite_b_192_rsa_ap_params()
  378. params["tls_flags"] = "[SUITEB-NO-ECDH]"
  379. params["dh_file"] = "auth_serv/dh.conf"
  380. hapd = hostapd.add_ap(apdev[0], params)
  381. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  382. ieee80211w="2",
  383. phase1="tls_suiteb=1",
  384. eap="TLS", identity="tls user",
  385. ca_cert="auth_serv/rsa3072-ca.pem",
  386. client_cert="auth_serv/rsa3072-user.pem",
  387. private_key="auth_serv/rsa3072-user.key",
  388. pairwise="GCMP-256", group="GCMP-256", scan_freq="2412",
  389. wait_connect=False)
  390. ev = dev[0].wait_event(["CTRL-EVENT-EAP-STATUS status='local TLS alert'",
  391. "CTRL-EVENT-CONNECTED"],
  392. timeout=10)
  393. dev[0].request("DISCONNECT")
  394. if ev is None:
  395. raise Exception("DH error not reported")
  396. if "CTRL-EVENT-CONNECTED" in ev:
  397. raise Exception("Unexpected connection")
  398. if "insufficient security" not in ev and "internal error" not in ev:
  399. raise Exception("Unexpected error reason: " + ev)
  400. def test_suite_b_192_rsa_radius(dev, apdev):
  401. """WPA2/GCMP-256 (RADIUS) connection at Suite B 192-bit level and RSA (ECDHE)"""
  402. check_suite_b_192_capa(dev)
  403. dev[0].flush_scan_cache()
  404. params = suite_b_as_params()
  405. params['ca_cert'] = 'auth_serv/rsa3072-ca.pem'
  406. params['server_cert'] = 'auth_serv/rsa3072-server.pem'
  407. params['private_key'] = 'auth_serv/rsa3072-server.key'
  408. del params['openssl_ciphers']
  409. params["tls_flags"] = "[SUITEB]"
  410. hostapd.add_ap(apdev[1], params)
  411. params = { "ssid": "test-suite-b",
  412. "wpa": "2",
  413. "wpa_key_mgmt": "WPA-EAP-SUITE-B-192",
  414. "rsn_pairwise": "GCMP-256",
  415. "group_mgmt_cipher": "BIP-GMAC-256",
  416. "ieee80211w": "2",
  417. "ieee8021x": "1",
  418. 'auth_server_addr': "127.0.0.1",
  419. 'auth_server_port': "18129",
  420. 'auth_server_shared_secret': "radius",
  421. 'nas_identifier': "nas.w1.fi" }
  422. hapd = hostapd.add_ap(apdev[0], params)
  423. dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B-192",
  424. ieee80211w="2",
  425. openssl_ciphers="ECDHE-RSA-AES256-GCM-SHA384",
  426. phase1="tls_suiteb=1",
  427. eap="TLS", identity="tls user",
  428. ca_cert="auth_serv/rsa3072-ca.pem",
  429. client_cert="auth_serv/rsa3072-user.pem",
  430. private_key="auth_serv/rsa3072-user.key",
  431. pairwise="GCMP-256", group="GCMP-256",
  432. group_mgmt="BIP-GMAC-256", scan_freq="2412")
  433. tls_cipher = dev[0].get_status_field("EAP TLS cipher")
  434. if tls_cipher != "ECDHE-RSA-AES256-GCM-SHA384" and \
  435. tls_cipher != "ECDHE-RSA-AES-256-GCM-AEAD":
  436. raise Exception("Unexpected TLS cipher: " + tls_cipher)