]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Prepare ap_wps_per_station_psk for the new wps=1 tag in PSK file
authorJouni Malinen <j@w1.fi>
Sat, 15 Feb 2020 15:37:07 +0000 (17:37 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Feb 2020 15:37:27 +0000 (17:37 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_wps.py

index 93b84cdaa4724cd491dee0dbf73e3ad1e14578c9..81475578b5e808e81da8ed5f489256d867c0b23d 100644 (file)
@@ -2161,7 +2161,15 @@ def get_psk(pskfile):
         for l in lines:
             if l == "# WPA PSKs":
                 continue
-            (addr, psk) = l.split(' ')
+            vals = l.split(' ')
+            if len(vals) == 2:
+                addr = vals[0]
+                psk = vals[1]
+            elif len(vals) == 3 and vals[0] == "wps=1":
+                addr = vals[1]
+                psk = vals[2]
+            else:
+                continue
             psks[addr] = psk
     return psks