def hs20_filters_connect(dev, apdev, disable_dgaf=False, proxy_arp=False):
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    params['hessid'] = bssid

    # Do not disable dgaf, to test that the station drops unicast IP packets
    # encrypted with GTK.
    params['disable_dgaf'] = '0'
    params['proxy_arp'] = '1'
    params['ap_isolate'] = '1'
    params['bridge'] = 'ap-br0'

    try:
        hapd = hostapd.add_ap(apdev[0], params)
    except:
        # For now, do not report failures due to missing kernel support.
        raise HwsimSkip("Could not start hostapd - assume proxyarp not supported in the kernel")

    subprocess.call(['brctl', 'setfd', 'ap-br0', '0'])
    subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'up'])

    dev[0].hs20_enable()

    id = dev[0].add_cred_values({ 'realm': "example.com",
                                  'username': "******",
                                  'password': "******",
                                  'ca_cert': "auth_serv/ca.pem",
                                  'domain': "example.com",
                                  'update_identifier': "1234" })
    interworking_select(dev[0], bssid, "home", freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")

    time.sleep(0.1)

    return dev[0], hapd
def test_ext_password_interworking(dev, apdev):
    """External password storage for Interworking network selection"""
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    hostapd.add_ap(apdev[0]['ifname'], params)

    dev[0].hs20_enable()
    dev[0].request("SET ext_password_backend test:pw1=password")
    id = dev[0].add_cred_values({ 'realm': "example.com",
                                  'username': "******" })
    dev[0].set_cred(id, "password", "ext:pw1")
    interworking_select(dev[0], bssid, freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")
示例#3
0
def test_ext_password_interworking(dev, apdev):
    """External password storage for Interworking network selection"""
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    hostapd.add_ap(apdev[0]['ifname'], params)

    dev[0].hs20_enable()
    dev[0].request("SET ext_password_backend test:pw1=password")
    id = dev[0].add_cred_values({ 'realm': "example.com",
                                  'username': "******" })
    dev[0].set_cred(id, "password", "ext:pw1")
    interworking_select(dev[0], bssid, freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")
示例#4
0
def test_hs20_pps_mo_1(dev, apdev):
    """Hotspot 2.0 PPS MO with username/password credential"""
    check_hs20_osu_client()
    check_eap_capa(dev[0], "MSCHAPV2")
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    params['hessid'] = bssid
    params['nai_realm'] = ["0,w1.fi,13[5:6],21[2:4][5:7]",
                           "0,another.example.com"]
    params['domain_name'] = "w1.fi"
    hapd = hostapd.add_ap(apdev[0], params)

    dev[0].hs20_enable()
    set_pps("pps-mo-1.xml")
    interworking_select(dev[0], bssid, "home", freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")
    check_sp_type(dev[0], "home")
示例#5
0
def test_hs20_pps_mo_1(dev, apdev):
    """Hotspot 2.0 PPS MO with username/password credential"""
    check_hs20_osu_client()
    check_eap_capa(dev[0], "MSCHAPV2")
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    params['hessid'] = bssid
    params['nai_realm'] = [
        "0,w1.fi,13[5:6],21[2:4][5:7]", "0,another.example.com"
    ]
    params['domain_name'] = "w1.fi"
    hapd = hostapd.add_ap(apdev[0], params)

    dev[0].hs20_enable()
    set_pps("pps-mo-1.xml")
    interworking_select(dev[0], bssid, "home", freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")
    check_sp_type(dev[0], "home")
示例#6
0
def hs20_filters_connect(dev, apdev, disable_dgaf=False, proxy_arp=False):
    bssid = apdev[0]['bssid']
    params = hs20_ap_params()
    params['hessid'] = bssid

    # Do not disable dgaf, to test that the station drops unicast IP packets
    # encrypted with GTK.
    params['disable_dgaf'] = '0'
    params['proxy_arp'] = '1'
    params['ap_isolate'] = '1'
    params['bridge'] = 'ap-br0'

    try:
        hapd = hostapd.add_ap(apdev[0], params)
    except:
        # For now, do not report failures due to missing kernel support.
        raise HwsimSkip(
            "Could not start hostapd - assume proxyarp not supported in the kernel"
        )

    subprocess.call(['brctl', 'setfd', 'ap-br0', '0'])
    subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'up'])

    dev[0].hs20_enable()

    id = dev[0].add_cred_values({
        'realm': "example.com",
        'username': "******",
        'password': "******",
        'ca_cert': "auth_serv/ca.pem",
        'domain': "example.com",
        'update_identifier': "1234"
    })
    interworking_select(dev[0], bssid, "home", freq="2412")
    interworking_connect(dev[0], bssid, "TTLS")

    time.sleep(0.1)

    return dev[0], hapd