From afd10e880b8b487526a20a1c3471579a6b0b2b36 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 15 Feb 2020 17:38:22 +0200 Subject: [PATCH] tests: Require wps=1 tag in ap_wps_per_station_psk Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 81475578b..b7515937e 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -2162,14 +2162,10 @@ def get_psk(pskfile): if l == "# WPA PSKs": continue 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: + if len(vals) != 3 or vals[0] != "wps=1": continue + addr = vals[1] + psk = vals[2] psks[addr] = psk return psks