mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-19 03:48:34 +03:00
pySim/utils.py: Attempt to support pycryptodpme
This should resolve the following error when using with pycryptodome instead of pycrypto: TypeError: new() missing 1 required positional argument: 'mode' Change-Id: Ibd3ca00d62b864909f5e89e0feb350268157a4ca Related: OS#5060
This commit is contained in:
@@ -246,7 +246,7 @@ def derive_milenage_opc(ki_hex, op_hex):
|
||||
# We pass in hex string and now need to work on bytes
|
||||
ki_bytes = bytes(h2b(ki_hex))
|
||||
op_bytes = bytes(h2b(op_hex))
|
||||
aes = AES.new(ki_bytes)
|
||||
aes = AES.new(ki_bytes, AES.MODE_ECB)
|
||||
opc_bytes = aes.encrypt(op_bytes)
|
||||
return b2h(strxor(opc_bytes, op_bytes))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user