[PATCH v2 14/38] tests: Modify eap_proto 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_eap_proto.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py
index 46703f7c2..ed0feaad1 100644
--- a/tests/hwsim/test_eap_proto.py
+++ b/tests/hwsim/test_eap_proto.py
@@ -6830,7 +6830,7 @@ def test_eap_proto_fast_errors(dev, apdev):
               "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nI-ID=1\nEND\n",
               "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nA-ID-Info=1\nEND\n" ]
     for pac in tests:
-        blob = binascii.hexlify(pac)
+        blob = binascii.hexlify(pac.encode()).decode()
         dev[0].request("SET blob fast_pac_errors " + blob)
         dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412",
                        eap="FAST", anonymous_identity="FAST",
@@ -6849,7 +6849,7 @@ def test_eap_proto_fast_errors(dev, apdev):
     tests = [ "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nEND\n",
               "wpa_supplicant EAP-FAST PAC file - version 1\nSTART\nEND\nSTART\nEND\nSTART\nEND\n" ]
     for pac in tests:
-        blob = binascii.hexlify(pac)
+        blob = binascii.hexlify(pac.encode()).decode()
         dev[0].request("SET blob fast_pac_errors " + blob)
         dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412",
                        eap="FAST", anonymous_identity="FAST",
@@ -8306,8 +8306,8 @@ def test_eap_fast_proto_phase2(dev, apdev):
                struct.pack(">HHB", EAP_TLV_INTERMEDIATE_RESULT_TLV, 1, 0xff),
                True),
               ("EAP-FAST: More than one Crypto-Binding TLV in the message",
-               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A' +
-               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A',
+               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A' +
+               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A',
                True),
               ("EAP-FAST: Too short Crypto-Binding TLV",
                struct.pack(">HHB", EAP_TLV_CRYPTO_BINDING_TLV, 1, 0xff),
@@ -8364,7 +8364,7 @@ def test_eap_fast_proto_phase2(dev, apdev):
                struct.pack(">HHHHHHHH", EAP_TLV_PAC_TLV, 4 + 4 + 4 + 32,
                            PAC_TYPE_PAC_OPAQUE, 0,
                            PAC_TYPE_PAC_INFO, 0,
-                           PAC_TYPE_PAC_KEY, 32) + 32*'A',
+                           PAC_TYPE_PAC_KEY, 32) + 32 * b'A',
                True),
               ("EAP-FAST: Invalid CRED_LIFETIME length, Ignored unknown PAC-Info type 0, and Invalid PAC-Type length 1",
                struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2,
@@ -8373,7 +8373,7 @@ def test_eap_fast_proto_phase2(dev, apdev):
                            PAC_TYPE_PAC_OPAQUE, 0,
                            PAC_TYPE_PAC_INFO, 13, PAC_TYPE_CRED_LIFETIME, 0,
                            0, 0, PAC_TYPE_PAC_TYPE, 1, 0,
-                           PAC_TYPE_PAC_KEY, 32) + 32*'A',
+                           PAC_TYPE_PAC_KEY, 32) + 32 * b'A',
                True),
               ("EAP-FAST: Unsupported PAC-Type 0",
                struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2,
@@ -8381,7 +8381,7 @@ def test_eap_fast_proto_phase2(dev, apdev):
                struct.pack(">HHHHHHHHHHH", EAP_TLV_PAC_TLV, 4 + 4 + 6 + 4 + 32,
                            PAC_TYPE_PAC_OPAQUE, 0,
                            PAC_TYPE_PAC_INFO, 6, PAC_TYPE_PAC_TYPE, 2, 0,
-                           PAC_TYPE_PAC_KEY, 32) + 32*'A',
+                           PAC_TYPE_PAC_KEY, 32) + 32 * b'A',
                True),
               ("EAP-FAST: PAC-Info overrun (type=0 len=2 left=1)",
                struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2,
@@ -8389,7 +8389,7 @@ def test_eap_fast_proto_phase2(dev, apdev):
                struct.pack(">HHHHHHHHBHH", EAP_TLV_PAC_TLV, 4 + 4 + 5 + 4 + 32,
                            PAC_TYPE_PAC_OPAQUE, 0,
                            PAC_TYPE_PAC_INFO, 5, 0, 2, 1,
-                           PAC_TYPE_PAC_KEY, 32) + 32*'A',
+                           PAC_TYPE_PAC_KEY, 32) + 32 * b'A',
                True),
               ("EAP-FAST: Valid PAC",
                struct.pack(">HHH", EAP_TLV_RESULT_TLV, 2,
@@ -8399,10 +8399,10 @@ def test_eap_fast_proto_phase2(dev, apdev):
                            PAC_TYPE_PAC_OPAQUE, 0,
                            PAC_TYPE_PAC_INFO, 10, PAC_TYPE_A_ID, 1, 0x41,
                            PAC_TYPE_A_ID_INFO, 1, 0x42,
-                           PAC_TYPE_PAC_KEY, 32) + 32*'A',
+                           PAC_TYPE_PAC_KEY, 32) + 32 * b'A',
                True),
               ("EAP-FAST: Invalid version/subtype in Crypto-Binding TLV",
-               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60*'A',
+               struct.pack(">HH", EAP_TLV_CRYPTO_BINDING_TLV, 60) + 60 * b'A',
                True) ]
     for title, payload, failure in tests:
         logger.info("Phase 2 test: " + title)
-- 
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