]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify NtPasswordHash with different UTF-8 cases
authorJouni Malinen <j@w1.fi>
Sat, 15 Feb 2014 10:08:50 +0000 (12:08 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Feb 2014 10:08:50 +0000 (12:08 +0200)
This adds a password that uses one, two, and three octet encoding
for UTF-8 characters. The value is tested against a pre-configured
hash to verify that utf8_to_ucs2() function works correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/auth_serv/eap_user.conf
tests/hwsim/test_ap_eap.py

index 19bfe65239626cc0da8d76bb387129220bafe1fc..edc111b7bd5ec017d781969be38322e5974c6beb 100644 (file)
@@ -33,6 +33,8 @@
 "mschap user"  TTLS-MSCHAP     "password"      [2]
 "DOMAIN\mschapv2 user" TTLS-MSCHAPV2   hash:8846f7eaee8fb117ad06bdd830b7586c   [2]
 "hs20-test"    TTLS-MSCHAPV2   "password"      [2]
+"utf8-user"    TTLS-MSCHAPV2   "secret-åäö-€-password"    [2]
+"utf8-user-hash"       TTLS-MSCHAPV2   hash:bd5844fad2489992da7fe8c5a01559cf   [2]
 
 "user" MSCHAPV2,MD5,GTC        "password"      [2]
 "cert user"    TLS     [2]
index 563cb7f4864c48c0aa043f707f34bbfda5b14cea..640e526a474cd2769fb6e27f943744911bf18df3 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 #
 # WPA2-Enterprise tests
 # Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi>
@@ -231,6 +232,19 @@ def test_ap_wpa2_eap_ttls_mschapv2(dev, apdev):
                 ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
                 expect_failure=True)
 
+def test_ap_wpa2_eap_ttls_mschapv2_utf8(dev, apdev):
+    """WPA2-Enterprise connection using EAP-TTLS/MSCHAPv2 and UTF-8 password"""
+    params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")
+    hostapd.add_ap(apdev[0]['ifname'], params)
+    hapd = hostapd.Hostapd(apdev[0]['ifname'])
+    eap_connect(dev[0], apdev[0], "TTLS", "utf8-user-hash",
+                anonymous_identity="ttls", password="secret-åäö-€-password",
+                ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2")
+    eap_connect(dev[1], apdev[0], "TTLS", "utf8-user",
+                anonymous_identity="ttls",
+                password_hex="hash:bd5844fad2489992da7fe8c5a01559cf",
+                ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2")
+
 def test_ap_wpa2_eap_ttls_eap_gtc(dev, apdev):
     """WPA2-Enterprise connection using EAP-TTLS/EAP-GTC"""
     params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")