|
@@ -1980,6 +1980,77 @@ def test_ap_wpa2_eap_tls_ocsp_invalid(dev, apdev):
|
|
|
if ev is None:
|
|
|
raise Exception("Timeout on EAP failure report")
|
|
|
|
|
|
+def test_ap_wpa2_eap_ttls_ocsp_revoked(dev, apdev, params):
|
|
|
+ """WPA2-Enterprise connection using EAP-TTLS and OCSP status revoked"""
|
|
|
+ ocsp = os.path.join(params['logdir'], "ocsp-server-cache-revoked.der")
|
|
|
+ if not os.path.exists(ocsp):
|
|
|
+ raise HwsimSkip("No OCSP response available")
|
|
|
+ params = int_eap_server_params()
|
|
|
+ params["ocsp_stapling_response"] = ocsp
|
|
|
+ hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
+ dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
+ identity="pap user", ca_cert="auth_serv/ca.pem",
|
|
|
+ anonymous_identity="ttls", password="password",
|
|
|
+ phase2="auth=PAP", ocsp=2,
|
|
|
+ wait_connect=False, scan_freq="2412")
|
|
|
+ count = 0
|
|
|
+ while True:
|
|
|
+ ev = dev[0].wait_event(["CTRL-EVENT-EAP-STATUS"])
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("Timeout on EAP status")
|
|
|
+ if 'bad certificate status response' in ev:
|
|
|
+ break
|
|
|
+ if 'certificate revoked' in ev:
|
|
|
+ break
|
|
|
+ count = count + 1
|
|
|
+ if count > 10:
|
|
|
+ raise Exception("Unexpected number of EAP status messages")
|
|
|
+
|
|
|
+ ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"])
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("Timeout on EAP failure report")
|
|
|
+
|
|
|
+def test_ap_wpa2_eap_ttls_ocsp_unknown(dev, apdev, params):
|
|
|
+ """WPA2-Enterprise connection using EAP-TTLS and OCSP status revoked"""
|
|
|
+ ocsp = os.path.join(params['logdir'], "ocsp-server-cache-unknown.der")
|
|
|
+ if not os.path.exists(ocsp):
|
|
|
+ raise HwsimSkip("No OCSP response available")
|
|
|
+ params = int_eap_server_params()
|
|
|
+ params["ocsp_stapling_response"] = ocsp
|
|
|
+ hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
+ dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
+ identity="pap user", ca_cert="auth_serv/ca.pem",
|
|
|
+ anonymous_identity="ttls", password="password",
|
|
|
+ phase2="auth=PAP", ocsp=2,
|
|
|
+ wait_connect=False, scan_freq="2412")
|
|
|
+ count = 0
|
|
|
+ while True:
|
|
|
+ ev = dev[0].wait_event(["CTRL-EVENT-EAP-STATUS"])
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("Timeout on EAP status")
|
|
|
+ if 'bad certificate status response' in ev:
|
|
|
+ break
|
|
|
+ count = count + 1
|
|
|
+ if count > 10:
|
|
|
+ raise Exception("Unexpected number of EAP status messages")
|
|
|
+
|
|
|
+ ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"])
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("Timeout on EAP failure report")
|
|
|
+
|
|
|
+def test_ap_wpa2_eap_ttls_optional_ocsp_unknown(dev, apdev, params):
|
|
|
+ """WPA2-Enterprise connection using EAP-TTLS and OCSP status revoked"""
|
|
|
+ ocsp = os.path.join(params['logdir'], "ocsp-server-cache-unknown.der")
|
|
|
+ if not os.path.exists(ocsp):
|
|
|
+ raise HwsimSkip("No OCSP response available")
|
|
|
+ params = int_eap_server_params()
|
|
|
+ params["ocsp_stapling_response"] = ocsp
|
|
|
+ hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
+ dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS",
|
|
|
+ identity="pap user", ca_cert="auth_serv/ca.pem",
|
|
|
+ anonymous_identity="ttls", password="password",
|
|
|
+ phase2="auth=PAP", ocsp=1, scan_freq="2412")
|
|
|
+
|
|
|
def test_ap_wpa2_eap_tls_domain_suffix_match_cn_full(dev, apdev):
|
|
|
"""WPA2-Enterprise using EAP-TLS and domain suffix match (CN)"""
|
|
|
params = int_eap_server_params()
|