]>
Commit | Line | Data |
---|---|---|
b652daca JM |
1 | # Suite B tests |
2 | # Copyright (c) 2014, 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 | ||
7 | import time | |
8 | import logging | |
9 | logger = logging.getLogger() | |
10 | ||
11 | import hostapd | |
12 | ||
13 | def test_suite_b(dev, apdev): | |
14 | """WPA2-PSK/GCMP connection""" | |
15 | if "GCMP" not in dev[0].get_capability("pairwise"): | |
16 | return "skip" | |
17 | params = hostapd.wpa2_eap_params(ssid="test-suite-b") | |
18 | params["wpa_key_mgmt"] = "WPA-EAP-SUITE-B" | |
19 | params['rsn_pairwise'] = "GCMP" | |
20 | hapd = hostapd.add_ap(apdev[0]['ifname'], params) | |
21 | # TODO: Force Suite B configuration for TLS | |
22 | dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B", | |
23 | eap="TLS", identity="tls user", ca_cert="auth_serv/ca.pem", | |
24 | client_cert="auth_serv/user.pem", | |
25 | private_key="auth_serv/user.key", | |
26 | pairwise="GCMP", group="GCMP", scan_freq="2412") | |
27 | dev[0].request("DISCONNECT") | |
28 | ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=20) | |
29 | if ev is None: | |
30 | raise Exception("Disconnection event timed out") | |
31 | dev[0].dump_monitor() | |
32 | dev[0].request("RECONNECT") | |
33 | ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED", | |
34 | "CTRL-EVENT-CONNECTED"], timeout=20) | |
35 | if ev is None: | |
36 | raise Exception("Roaming with the AP timed out") | |
37 | if "CTRL-EVENT-EAP-STARTED" in ev: | |
38 | raise Exception("Unexpected EAP exchange") |