]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify random WPS PIN generation
authorJouni Malinen <j@w1.fi>
Sun, 6 Apr 2014 13:26:22 +0000 (16:26 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 6 Apr 2014 21:56:04 +0000 (00:56 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_wps.py

index b6412d5ca5c4adfb3465650adeaa7d7846f0ffd0..33a6f861e2a044519594f93e021eefc229897e2a 100644 (file)
@@ -1153,6 +1153,12 @@ def test_ap_wps_check_pin(dev, apdev):
     if "FAIL" not in hapd.request("WPS_CHECK_PIN 123456789"):
         raise Exception("Unexpected WPS_CHECK_PIN success")
 
+    for i in range(0, 10):
+        pin = dev[0].request("WPS_PIN get")
+        rpin = dev[0].request("WPS_CHECK_PIN " + pin).rstrip('\n')
+        if pin != rpin:
+            raise Exception("Random PIN validation failed for " + pin)
+
 def test_ap_wps_wep_config(dev, apdev):
     """WPS 2.0 AP rejecting WEP configuration"""
     ssid = "test-wps-config"