[PATCH 4 of 7 cubicweb/debian] [crypto] Use Cryptodome namespace instead of Crypto

Jérémy Bobbio jeremy.bobbio at irq7.fr
Wed Jun 19 19:15:41 CEST 2019


# HG changeset patch
# User Jérémy Bobbio <jeremy.bobbio at irq7.fr>
# Date 1560951857 -7200
#      Wed Jun 19 15:44:17 2019 +0200
# Node ID 2b020d32bacab73ed15f1ff9000a76b21f32e038
# Parent  4cfd880b8c9df494ad300163e4a56313ba402ce8
[crypto] Use Cryptodome namespace instead of Crypto

PyCryptodome comes in two flavors: “an almost drop-in replacement for the old
PyCrypto library” and “a library independent of the old PyCrypto”. The former
uses the Crypto namespace, and is shipped as `pycryptodome` while the latter
uses Cryptodome instead and lies in the `pycryptodomex` package.

Given the reason to switch to PyCryptodome is that PyCrypto in unmaintained,
its probably better to avoid any mistake and mandate the specific usage of
the Cryptodome namespace by requiring `pycryptodomex` instead of
`pycryptodome`.

A more present reason is that Debian buster will only provide a package
with the separate namespace flavor. The current Recommends is not working with
the current code. Although it's important to note that the package name will
probably have to be changed to `python3-pycryptodomex` once
https://bugs.debian.org/886291 is solved.

diff -r 4cfd880b8c9d -r 2b020d32baca cubicweb/crypto.py
--- a/cubicweb/crypto.py	Mon Jun 17 11:12:03 2019 +0200
+++ b/cubicweb/crypto.py	Wed Jun 19 15:44:17 2019 +0200
@@ -21,7 +21,7 @@
 from base64 import b64encode, b64decode
 import pickle
 
-from Crypto.Cipher import Blowfish
+from Cryptodome.Cipher import Blowfish
 
 
 _CYPHERERS = {}
diff -r 4cfd880b8c9d -r 2b020d32baca setup.py
--- a/setup.py	Mon Jun 17 11:12:03 2019 +0200
+++ b/setup.py	Wed Jun 19 15:44:17 2019 +0200
@@ -87,7 +87,7 @@
             'Pillow',
         ],
         'crypto': [
-            'pycryptodome',
+            'pycryptodomex',
         ],
         'ext': [
             'docutils >= 0.6',


More information about the cubicweb-devel mailing list