]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Set ECB mode for AES explicitly to work with cryptodome
authorJouni Malinen <j@w1.fi>
Sun, 22 May 2022 08:07:05 +0000 (11:07 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 22 May 2022 08:08:23 +0000 (11:08 +0300)
AES.new() needs the mode to be set explicitly.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_psk.py

index 652eae4a8c47bb3ac094f0eea51f00f7dde92b9f..e9c7d5adc7ca8f804c694dc1ad5cd3ea1890742a 100644 (file)
@@ -1763,7 +1763,7 @@ def build_eapol_key_3_4(anonce, kck, key_data, replay_counter=2,
 def aes_wrap(kek, plain):
     n = len(plain) // 8
     a = 0xa6a6a6a6a6a6a6a6
-    enc = AES.new(kek).encrypt
+    enc = AES.new(kek, AES.MODE_ECB).encrypt
     r = [plain[i * 8:(i + 1) * 8] for i in range(0, n)]
     for j in range(6):
         for i in range(1, n + 1):