[Python-modules-team] Bug#886291: pycryptodome naming

Petter Reinholdtsen pere at hungry.com
Thu Jun 14 09:57:39 BST 2018


[Andres Salomon]
> I modified the package to provide/conflict with python-crypto, and that
> seems to work.  I didn't test upgrade paths, though.

Would it be better to introduce a extra set of Crypto compatible packages?
It would allow those packages using the current namespace to keep working
without changes, and allow them to use the "compat" packages if they
want to.

I just uploaded python-httpsig with the following patch to get it to work
with Cryptodome, and it was not too intrusive:

Index: python-httpsig/httpsig/sign.py
===================================================================
--- python-httpsig.orig/httpsig/sign.py	2018-06-14 08:37:32.408021349 +0000
+++ python-httpsig/httpsig/sign.py	2018-06-14 08:37:32.408021349 +0000
@@ -1,9 +1,9 @@
 import base64
 import six
 
-from Crypto.Hash import HMAC
-from Crypto.PublicKey import RSA
-from Crypto.Signature import PKCS1_v1_5
+from Cryptodome.Hash import HMAC
+from Cryptodome.PublicKey import RSA
+from Cryptodome.Signature import PKCS1_v1_5
 
 from .utils import *
 
Index: python-httpsig/httpsig/utils.py
===================================================================
--- python-httpsig.orig/httpsig/utils.py	2018-06-14 08:37:32.408021349 +0000
+++ python-httpsig/httpsig/utils.py	2018-06-14 08:37:32.408021349 +0000
@@ -11,7 +11,7 @@
     # Python 2
     from urllib2 import parse_http_list
 
-from Crypto.Hash import SHA, SHA256, SHA512
+from Cryptodome.Hash import SHA, SHA256, SHA512
 
 ALGORITHMS = frozenset([
                 'rsa-sha1',
Index: python-httpsig/setup.py
===================================================================
--- python-httpsig.orig/setup.py	2018-06-14 08:37:44.912143622 +0000
+++ python-httpsig/setup.py	2018-06-14 08:42:15.662330444 +0000
@@ -37,6 +37,6 @@
     zip_safe=True,
     #use_scm_version=True,
     setup_requires=['setuptools_scm'],
-    install_requires=['pycryptodome>=3.4.7', 'six'],
+    install_requires=['pycryptodomex>=3.4.7', 'six'],
     test_suite="httpsig.tests",
 )



More information about the Python-modules-team mailing list