From 861671b6cab79214122cb44ce5c2409667929074 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 6 Apr 2014 16:31:44 +0300 Subject: [PATCH] tests: Use random WPS PIN Signed-off-by: Jouni Malinen --- tests/hwsim/wpasupplicant.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index cb3d7cf43..e65bf0c83 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/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):