[PATCH v2 15/38] tests: Modify erp test sets for python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Masashi Honma <masashi.honma@xxxxxxxxx>
---
 tests/hwsim/test_ap_psk.py | 2 +-
 tests/hwsim/test_erp.py    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py
index 92919b7f8..03be59cd3 100644
--- a/tests/hwsim/test_ap_psk.py
+++ b/tests/hwsim/test_ap_psk.py
@@ -2376,7 +2376,7 @@ def verify_not_present(buf, key, fname, keyname):
         return
 
     prefix = 2048 if pos > 2048 else pos
-    with open(fname + keyname, 'w') as f:
+    with open(fname + keyname, 'wb') as f:
         f.write(buf[pos - prefix:pos + 2048])
     raise Exception(keyname + " found after disassociation")
 
diff --git a/tests/hwsim/test_erp.py b/tests/hwsim/test_erp.py
index 866dea4aa..64e77cd11 100644
--- a/tests/hwsim/test_erp.py
+++ b/tests/hwsim/test_erp.py
@@ -331,7 +331,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params):
     get_key_locations(buf, emsk, "EMSK")
     get_key_locations(buf, rRK, "rRK")
     get_key_locations(buf, rIK, "rIK")
-    if password not in buf:
+    if password.encode() not in buf:
         raise HwsimSkip("Password not found while associated")
     if pmk not in buf:
         raise HwsimSkip("PMK not found while associated")
@@ -423,7 +423,7 @@ def test_erp_key_lifetime_in_memory(dev, apdev, params):
     get_key_locations(buf, emsk, "EMSK")
     get_key_locations(buf, rRK, "rRK")
     get_key_locations(buf, rIK, "rIK")
-    verify_not_present(buf, password, fname, "password")
+    verify_not_present(buf, binascii.unhexlify(password), fname, "password")
     verify_not_present(buf, pmk, fname, "PMK")
     verify_not_present(buf, kck, fname, "KCK")
     verify_not_present(buf, kek, fname, "KEK")
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux