[S] Change in pysim[master]: Switch from pycryptodome to pycryptodomex
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33124 ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Switch from pycryptodome to pycryptodomex ...................................................................... Switch from pycryptodome to pycryptodomex So for some weird historical reasons, the same python module is available as pycryptodome (Crypto.* namespace) and pycryptodomex (Cryptodome.* namespace). See the following information on the project homepage: https://www.pycryptodome.org/src/installation To make things extra-weird, Debian choose to package pycryptodomex as python3-pycryptodome (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886291). So in order to support both Debian-packaged and differently-installed packages, let's switch to pycryotodomex on all platforms/installers. Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62 --- M README.md M pySim/ota.py M pySim/utils.py M requirements.txt M setup.py 5 files changed, 29 insertions(+), 7 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve dexter: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.md b/README.md index 025b518..db13a52 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ - termcolor - colorlog - packaging - - pycryptodome + - pycryptodomex Example for Debian: ```sh @@ -54,6 +54,7 @@ pcscd libpcsclite-dev \ python3 \ python3-setuptools \ + python3-pycryptodome \ python3-pyscard \ python3-pip pip3 install --user -r requirements.txt diff --git a/pySim/ota.py b/pySim/ota.py index 83303a6..5955a08 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -150,8 +150,8 @@ pass -from Crypto.Cipher import DES, DES3, AES -from Crypto.Hash import CMAC +from Cryptodome.Cipher import DES, DES3, AES +from Cryptodome.Hash import CMAC class OtaAlgo(abc.ABC): iv = property(lambda self: bytes([0] * self.blocksize)) diff --git a/pySim/utils.py b/pySim/utils.py index 6b8ee37..537014f 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -616,9 +616,9 @@ """ Run the milenage algorithm to calculate OPC from Ki and OP """ - from Crypto.Cipher import AES + from Cryptodome.Cipher import AES # pylint: disable=no-name-in-module - from Crypto.Util.strxor import strxor + from Cryptodome.Util.strxor import strxor from pySim.utils import b2h # We pass in hex string and now need to work on bytes diff --git a/requirements.txt b/requirements.txt index fb94472..b12cb4d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ pyyaml>=5.1 termcolor colorlog -pycryptodome +pycryptodomex packaging diff --git a/setup.py b/setup.py index d14ebc6..d4fb15f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ "pyyaml >= 5.1", "termcolor", "colorlog", - "pycryptodome", + "pycryptodomex", "packaging", ], scripts=[ -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33124 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62 Gerrit-Change-Number: 33124 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
laforge