aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-03-05 18:39:59 +0100
committerlaforge <laforge@osmocom.org>2021-03-05 20:39:18 +0000
commitab34fa895effb209ae737fe3edffe1b430d4116f (patch)
tree8c15359a1223b74257d1375ba2ef67137e5cef55
parenteab8d2adf772e0da8c363ec0f68c155797675eca (diff)
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
-rw-r--r--pySim/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pySim/utils.py b/pySim/utils.py
index 13e62f0..f7190d4 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -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))