aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-01 19:30:57 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-01 19:30:57 (GMT)
commit3bdf7d7f677693dce014cfb9d5adda9cd218523b (patch)
treeee9107ed8d2faa88be0cb11ab1f578a3ff6c0674
parent474d209057fd4bd2ece801c3c515b6e01b83f9ad (diff)
downloadhostap-3bdf7d7f677693dce014cfb9d5adda9cd218523b.zip
hostap-3bdf7d7f677693dce014cfb9d5adda9cd218523b.tar.gz
hostap-3bdf7d7f677693dce014cfb9d5adda9cd218523b.tar.bz2
tests: Verify WPS_CHECK_PIN functionality
Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_ap_wps.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py
index b1fa989..36a2bce 100644
--- a/tests/hwsim/test_ap_wps.py
+++ b/tests/hwsim/test_ap_wps.py
@@ -813,3 +813,22 @@ def test_ap_wps_new_version_ap(dev, apdev):
hapd.request("SET wps_version_number 0x20")
if ev is None:
raise Exception("Association with the AP timed out")
+
+def test_ap_wps_check_pin(dev, apdev):
+ """Verify PIN checking through control interface"""
+ hostapd.add_ap(apdev[0]['ifname'],
+ { "ssid": "wps", "eap_server": "1", "wps_state": "2",
+ "wpa_passphrase": "12345678", "wpa": "2",
+ "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" })
+ hapd = hostapd.Hostapd(apdev[0]['ifname'])
+ for t in [ ("12345670", "12345670"),
+ ("12345678", "FAIL-CHECKSUM"),
+ ("1234-5670", "12345670"),
+ ("1234 5670", "12345670"),
+ ("1-2.3:4 5670", "12345670") ]:
+ res = hapd.request("WPS_CHECK_PIN " + t[0]).rstrip('\n')
+ res2 = dev[0].request("WPS_CHECK_PIN " + t[0]).rstrip('\n')
+ if res != res2:
+ raise Exception("Unexpected difference in WPS_CHECK_PIN responses")
+ if res != t[1]:
+ raise Exception("Incorrect WPS_CHECK_PIN response {} (expected {})".format(res, t[1]))