]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Hotspot 2.0 Terms and Conditions signaling
authorJouni Malinen <jouni@codeaurora.org>
Mon, 23 Apr 2018 18:10:30 +0000 (21:10 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 23 Apr 2018 21:35:47 +0000 (00:35 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/auth_serv/eap_user.conf
tests/hwsim/test_ap_hs20.py

index cc2185f492c272ebca59bbf264d3d702ba0baaee..75f8c633ec6c8555a95aa6626ae9c8fefe3a9ecb 100644 (file)
@@ -143,3 +143,6 @@ radius_accept_attr=26:x:00009f6801170168747470733a2f2f6578616d706c652e636f6d2f
 "hs20-session-info-test"       TTLS-MSCHAPV2   "password"      [2]
 radius_accept_attr=27:d:63
 radius_accept_attr=26:x:00009f6805170168747470733a2f2f6578616d706c652e636f6d2f
+
+"hs20-t-c-test"        TTLS-MSCHAPV2   "password"      [2]
+radius_accept_attr=26:x:00009f68090601000000
index e9afd1b5c1585be418f68ebc64c7142894931219..ae5a2884d38fb12c4dafefef39568762a5ac312b 100644 (file)
@@ -5722,3 +5722,26 @@ def test_ap_interworking_element_update(dev, apdev):
     logger.info("After update: " + str(bss))
     if '6b09f20208020000000300' not in bss['ie']:
         raise Exception("Expected Interworking element not seen after update")
+
+def test_ap_hs20_terms_and_conditions(dev, apdev):
+    """Hotspot 2.0 Terms and Conditions signaling"""
+    check_eap_capa(dev[0], "MSCHAPV2")
+    bssid = apdev[0]['bssid']
+    params = hs20_ap_params()
+    params['hessid'] = bssid
+    params['hs20_t_c_filename'] = 'terms-and-conditions'
+    params['hs20_t_c_timestamp'] = '123456789'
+    params['hs20_t_c_server_url'] = 'https://example.com/t_and_c?addr=@1@&ap=123'
+    hostapd.add_ap(apdev[0], params)
+
+    dev[0].hs20_enable()
+    dev[0].connect("test-hs20", proto="RSN", key_mgmt="WPA-EAP", eap="TTLS",
+                   identity="hs20-t-c-test", password="password",
+                   ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
+                   ieee80211w='2', scan_freq="2412")
+    ev = dev[0].wait_event(["HS20-T-C-ACCEPTANCE"], timeout=5)
+    if ev is None:
+        raise Exception("Terms and Conditions Acceptance notification not received")
+    url = "https://example.com/t_and_c?addr=%s&ap=123" % dev[0].own_addr()
+    if url not in ev:
+        raise Exception("Unexpected URL: " + ev)