From e36a7c7940f89ab544ca827be0924d2b23b3e359 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 22 May 2022 11:03:39 +0300 Subject: [PATCH] tests: Support pycryptodome This is a drop-in replacement for pycrypto and the only version that is now available in Ubuntu 22.04. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_psk.py | 5 ++++- tests/hwsim/test_ap_wps.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index e9c7d5adc..6901cae74 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -6,7 +6,10 @@ from remotehost import remote_compatible import binascii -from Crypto.Cipher import AES +try: + from Cryptodome.Cipher import AES +except ImportError: + from Crypto.Cipher import AES import hashlib import hmac import logging diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index e01c73a10..b397285f3 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -8,7 +8,10 @@ from remotehost import remote_compatible from tshark import run_tshark import base64 import binascii -from Crypto.Cipher import AES +try: + from Cryptodome.Cipher import AES +except ImportError: + from Crypto.Cipher import AES import hashlib import hmac import os