diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2017-09-12 13:47:30 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2017-09-12 13:47:30 (GMT) |
commit | f4ad8412b49e8571073b692fb32903c5f638824f (patch) | |
tree | d4916389f4ebeeeb347f7fd9373c6dc7ddb22088 /tests | |
parent | 2efc6720752dc6ed02e15885cdc28174ac85086f (diff) | |
download | hostap-f4ad8412b49e8571073b692fb32903c5f638824f.zip hostap-f4ad8412b49e8571073b692fb32903c5f638824f.tar.gz hostap-f4ad8412b49e8571073b692fb32903c5f638824f.tar.bz2 |
tests: RSN pre-authentication based on pre-connection scan results
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hwsim/test_pmksa_cache.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py index 28a7655..a117826 100644 --- a/tests/hwsim/test_pmksa_cache.py +++ b/tests/hwsim/test_pmksa_cache.py @@ -386,6 +386,42 @@ def test_pmksa_cache_and_cui(dev, apdev): if state != "COMPLETED": raise Exception("Reauthentication did not complete") +def test_pmksa_cache_preauth_auto(dev, apdev): + """RSN pre-authentication based on pre-connection scan results""" + try: + run_pmksa_cache_preauth_auto(dev, apdev) + finally: + hostapd.cmd_execute(apdev[0], ['ip', 'link', 'set', 'dev', + 'ap-br0', 'down', '2>', '/dev/null'], + shell=True) + hostapd.cmd_execute(apdev[0], ['brctl', 'delbr', 'ap-br0', + '2>', '/dev/null'], shell=True) + +def run_pmksa_cache_preauth_auto(dev, apdev): + params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") + params['bridge'] = 'ap-br0' + params['rsn_preauth'] = '1' + params['rsn_preauth_interfaces'] = 'ap-br0' + + hapd = hostapd.add_ap(apdev[0], params) + hapd.cmd_execute(['brctl', 'setfd', 'ap-br0', '0']) + hapd.cmd_execute(['ip', 'link', 'set', 'dev', 'ap-br0', 'up']) + hapd2 = hostapd.add_ap(apdev[1], params) + + eap_connect(dev[0], hapd, "PAX", "pax.user@example.com", + password_hex="0123456789abcdef0123456789abcdef") + + found = False + for i in range(20): + time.sleep(0.5) + res1 = dev[0].get_pmksa(apdev[0]['bssid']) + res2 = dev[0].get_pmksa(apdev[1]['bssid']) + if res1 and res2: + found = True + break + if not found: + raise Exception("The expected PMKSA cache entries not found") + def generic_pmksa_cache_preauth(dev, apdev, extraparams, identity, databridge, force_disconnect=False): if not extraparams: |