mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 11:48:33 +00:00
Prefer cyrptodomex if present
For compatibility, accept PyCrypto. However if Cryptodomex is present (explicit version of cryptodome), use that. This is an easier path to a modern supported AES implementation that continues to support older, but still prevalent long term linux distributions. Another project required cryptodome, and evidently it caused problems due to some interoperability with things that truly needed PyCrypto. Change-Id: I3c0601bc0b6ae56417e712b50337ec1c20eb89a2
This commit is contained in:
parent
5c5a0269d7
commit
c39e463c67
@ -27,7 +27,10 @@ import socket
|
||||
import struct
|
||||
import threading
|
||||
|
||||
from Crypto.Cipher import AES
|
||||
try:
|
||||
from Cryptodome.Cipher import AES
|
||||
except ImportError:
|
||||
from Crypto.Cipher import AES
|
||||
|
||||
import pyghmi.exceptions as exc
|
||||
from pyghmi.ipmi.private import constants
|
||||
|
Loading…
x
Reference in New Issue
Block a user