Parcourir la source

tests: Use random WPS PIN

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen il y a 11 ans
Parent
commit
861671b6ca
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      tests/hwsim/wpasupplicant.py

+ 3 - 2
tests/hwsim/wpasupplicant.py

@@ -332,8 +332,9 @@ class WpaSupplicant:
         return self.global_request("P2P_STOP_FIND")
 
     def wps_read_pin(self):
-        #TODO: make this random
-        self.pin = "12345670"
+        self.pin = self.request("WPS_PIN get").rstrip("\n")
+        if "FAIL" in self.pin:
+            raise Exception("Could not generate PIN")
         return self.pin
 
     def peer_known(self, peer, full=True):