mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
tests: EAP-MD5 server error cases
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
802bf82482
commit
ee9533eb0e
@ -15,7 +15,7 @@ import os
|
|||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
import hostapd
|
import hostapd
|
||||||
from utils import HwsimSkip
|
from utils import HwsimSkip, alloc_fail
|
||||||
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
|
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
|
||||||
|
|
||||||
def check_hlr_auc_gw_support():
|
def check_hlr_auc_gw_support():
|
||||||
@ -985,6 +985,39 @@ def test_ap_wpa2_eap_ttls_eap_md5(dev, apdev):
|
|||||||
hwsim_utils.test_connectivity(dev[0], hapd)
|
hwsim_utils.test_connectivity(dev[0], hapd)
|
||||||
eap_reauth(dev[0], "TTLS")
|
eap_reauth(dev[0], "TTLS")
|
||||||
|
|
||||||
|
def test_ap_wpa2_eap_ttls_eap_md5_incorrect_password(dev, apdev):
|
||||||
|
"""WPA2-Enterprise connection using EAP-TTLS/EAP-MD5 - incorrect password"""
|
||||||
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
||||||
|
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||||
|
eap_connect(dev[0], apdev[0], "TTLS", "user",
|
||||||
|
anonymous_identity="ttls", password="wrong",
|
||||||
|
ca_cert="auth_serv/ca.pem", phase2="autheap=MD5",
|
||||||
|
expect_failure=True)
|
||||||
|
|
||||||
|
def test_ap_wpa2_eap_ttls_eap_md5_server_oom(dev, apdev):
|
||||||
|
"""WPA2-Enterprise connection using EAP-TTLS/EAP-MD5 - server OOM"""
|
||||||
|
params = int_eap_server_params()
|
||||||
|
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||||
|
with alloc_fail(hapd, 1, "eap_md5_init"):
|
||||||
|
eap_connect(dev[0], apdev[0], "TTLS", "user",
|
||||||
|
anonymous_identity="ttls", password="password",
|
||||||
|
ca_cert="auth_serv/ca.pem", phase2="autheap=MD5",
|
||||||
|
expect_failure=True)
|
||||||
|
dev[0].request("REMOVE_NETWORK all")
|
||||||
|
|
||||||
|
with alloc_fail(hapd, 1, "eap_md5_buildReq"):
|
||||||
|
dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP WPA-EAP-SHA256",
|
||||||
|
eap="TTLS", identity="user",
|
||||||
|
anonymous_identity="ttls", password="password",
|
||||||
|
ca_cert="auth_serv/ca.pem", phase2="autheap=MD5",
|
||||||
|
wait_connect=False, scan_freq="2412")
|
||||||
|
# This would eventually time out, but we can stop after having reached
|
||||||
|
# the allocation failure.
|
||||||
|
for i in range(20):
|
||||||
|
time.sleep(0.1)
|
||||||
|
if hapd.request("GET_ALLOC_FAIL").startswith('0'):
|
||||||
|
break
|
||||||
|
|
||||||
def test_ap_wpa2_eap_ttls_eap_mschapv2(dev, apdev):
|
def test_ap_wpa2_eap_ttls_eap_mschapv2(dev, apdev):
|
||||||
"""WPA2-Enterprise connection using EAP-TTLS/EAP-MSCHAPv2"""
|
"""WPA2-Enterprise connection using EAP-TTLS/EAP-MSCHAPv2"""
|
||||||
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
|
||||||
|
Loading…
Reference in New Issue
Block a user