Exemplo n.º 1
0
def test_pasn_ft_psk(dev, apdev):
    """PASN authentication with FT-PSK"""
    check_pasn_capab(dev[0])

    ssid = "test-pasn-ft-psk"
    passphrase = "12345678"

    params = ft_params1(ssid=ssid, passphrase=passphrase)
    params['wpa_key_mgmt'] += " PASN"
    hapd0 = hostapd.add_ap(apdev[0], params)
    params = ft_params2(ssid=ssid, passphrase=passphrase)
    params['wpa_key_mgmt'] += " PASN"
    hapd1 = hostapd.add_ap(apdev[1], params)

    run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase)

    if dev[0].get_status_field('bssid') == apdev[0]['bssid']:
        pasn_hapd = hapd1
    else:
        pasn_hapd = hapd0

    check_pasn_akmp_cipher(dev[0], pasn_hapd, "FT-PSK", "CCMP")

    run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, only_one_way=1)

    if dev[0].get_status_field('bssid') == apdev[0]['bssid']:
        pasn_hapd = hapd1
    else:
        pasn_hapd = hapd0

    check_pasn_akmp_cipher(dev[0], pasn_hapd, "FT-PSK", "CCMP")
Exemplo n.º 2
0
def test_pasn_ft_eap_sha384(dev, apdev):
    """PASN authentication with FT-EAP-SHA-384"""
    check_pasn_capab(dev[0])

    ssid = "test-pasn-ft-psk"
    passphrase = "12345678"
    identity = "gpsk user"

    radius = hostapd.radius_params()
    params = ft_params1(ssid=ssid, passphrase=passphrase)
    params["ieee80211w"] = "2"
    params['wpa_key_mgmt'] = "FT-EAP-SHA384 PASN"
    params["ieee8021x"] = "1"
    params = dict(list(radius.items()) + list(params.items()))
    hapd0 = hostapd.add_ap(apdev[0], params)

    params = ft_params2(ssid=ssid, passphrase=passphrase)
    params["ieee80211w"] = "2"
    params['wpa_key_mgmt'] = "FT-EAP-SHA384 PASN"
    params["ieee8021x"] = "1"
    params = dict(list(radius.items()) + list(params.items()))
    hapd1 = hostapd.add_ap(apdev[1], params)

    run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, eap=True,
              sha384=True)

    if dev[0].get_status_field('bssid') == apdev[0]['bssid']:
        pasn_hapd = hapd1
    else:
        pasn_hapd = hapd0

    check_pasn_akmp_cipher(dev[0], pasn_hapd, "FT-EAP-SHA384", "CCMP")
Exemplo n.º 3
0
def run_wpa2_ocv_ap_override_ft_assoc(dev, apdev, post_enable=False):
    ssid = "test-wpa2-ocv"
    passphrase = "qwertyuiop"
    params = ft_params1(ssid=ssid, passphrase=passphrase)
    params["ieee80211w"] = "2"
    params["ocv"] = "1"
    if not post_enable:
        params["oci_freq_override_ft_assoc"] = "2462"
    try:
        hapd0 = hostapd.add_ap(apdev[0], params)
    except Exception as e:
        if "Failed to set hostapd parameter ocv" in str(e):
            raise HwsimSkip("OCV not supported")
        raise
    params = ft_params2(ssid=ssid, passphrase=passphrase)
    params["ieee80211w"] = "2"
    params["ocv"] = "1"
    if not post_enable:
        params["oci_freq_override_ft_assoc"] = "2462"
    hapd1 = hostapd.add_ap(apdev[1], params)

    if post_enable:
        hapd0.set("oci_freq_override_ft_assoc", "2462")
        hapd1.set("oci_freq_override_ft_assoc", "2462")

    dev[0].connect(ssid, key_mgmt="FT-PSK", psk=passphrase,
                   scan_freq="2412", ocv="1", ieee80211w="2")

    bssid = dev[0].get_status_field("bssid")
    bssid0 = hapd0.own_addr()
    bssid1 = hapd1.own_addr()
    target = bssid0 if bssid == bssid1 else bssid1

    dev[0].scan_for_bss(target, freq="2412")
    if "OK" not in dev[0].request("ROAM " + target):
        raise Exception("ROAM failed")

    check_ocv_failure(dev[0], "FT Reassociation Response", "ft-assoc", target)
    dev[0].request("DISCONNECT")