From 2815c2716b6bed4e1d688aadbb0ec4faa80e7ac2 Mon Sep 17 00:00:00 2001 From: codeface Date: Mon, 14 Sep 2020 17:48:47 +0800 Subject: [PATCH] build fix --- .../requirements-binaries.txt | 31 +++++++++++++++++++ .../deterministic-build/requirements-hw.txt | 4 +-- contrib/osx/README.md | 5 +++ .../requirements/requirements-binaries.txt | 1 + electrum/crypto.py | 19 ++++++------ 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/contrib/deterministic-build/requirements-binaries.txt b/contrib/deterministic-build/requirements-binaries.txt index ed98c0f44..65e3128fc 100644 --- a/contrib/deterministic-build/requirements-binaries.txt +++ b/contrib/deterministic-build/requirements-binaries.txt @@ -27,6 +27,37 @@ cffi==1.14.2 \ --hash=sha256:e4b9b7af398c32e408c00eb4e0d33ced2f9121fd9fb978e6c1b57edd014a7d15 \ --hash=sha256:e613514a82539fc48291d01933951a13ae93b6b444a88782480be32245ed4afa \ --hash=sha256:f5033952def24172e60493b68717792e3aebb387a8d186c43c020d9363ee7281 +pycryptodomex==3.9.7 \ + --hash=sha256:1537d2d15b604b303aef56e7f440895a1c81adbee786b91f1f06eddc34da5314 \ + --hash=sha256:1d20ab8369b7558168fc014a0745c678613f9f486dae468cca2d68145196b8a4 \ + --hash=sha256:1ecc9db7409db67765eb008e558879d298406642d33ade43a6488224d23e8081 \ + --hash=sha256:37033976f72af829fe15f7fe5fe1dbed308cc43a98d9dd9d2a0a76de8ca5ee78 \ + --hash=sha256:3c3dd9d4c9c1e279d3945ae422895c901f98987333acc132dc094faf52afec35 \ + --hash=sha256:3c9b3fba037ea52c626060c5a87ee6de7e86c99e8a7c6ee07302539985d2bd64 \ + --hash=sha256:45ee555fc5e28c119a46d44ce373f5237e54a35c61b750fb3a94446b09855dbc \ + --hash=sha256:4c93038ac011b36512cb0bf2ee3e2aec774e8bc81021d015917c89fe02bb0ee5 \ + --hash=sha256:50163324834edd0c9ce3e4512ded3e221c969086e10fdd5d3fdcaadac5e24a78 \ + --hash=sha256:59b0ea9cda5490f924771456912a225d8d9e678891f9f986661af718534719b2 \ + --hash=sha256:5cf306a17cccc327a33cdc3845629fa13f4573a4ec620ed607c79cf6785f2e27 \ + --hash=sha256:5fff8da399af16a1855f58771223acbbdac720b9969cd03fc5013d2e9a7bd9a4 \ + --hash=sha256:68650ce5b9f7152b8283302a4617269f821695a612692640dd247bd12ab21c0b \ + --hash=sha256:6b3a9a562688996f760b5077714c3ab8b62ca56061b6e9ab7906841e43e19f91 \ + --hash=sha256:7e938ed51a59e29431ea86fab60423ada2757728db0f78952329fa02a789bd31 \ + --hash=sha256:87aa70daad6f039e814790a06422a3189311198b674b62f13933a2bdcb6b1bcc \ + --hash=sha256:99be3a1df2b2b9f731ebe1c264a2c07c465e71cee68e35e1640b645b5213a755 \ + --hash=sha256:a3f2908666e6f74b8c4893f86dd02e16170f50e4a78ae7f3468b6208d54bc205 \ + --hash=sha256:ae3d44a639fd11dbdeca47e35e94febb1ee8bc15daf26673331add37146e0b85 \ + --hash=sha256:afb4c2fa3c6f492fd9a8b38d76e13f32d429b8e5e1e00238309391b5591cde0d \ + --hash=sha256:b1515ce3a8a2c3fa537d137c5ca5f8b7a902044d04e07d7c3aa26c3e026120fb \ + --hash=sha256:bf391b377413a197000b43ef2b74359974d8927d329a897c9f5ba7b63dca7b9c \ + --hash=sha256:c436919117c23355740c669f89720673578b9aa4569bbfe105f6c10101fc1966 \ + --hash=sha256:d2c3c280975638e2a2c2fd9cb36ab111980219757fa163a2755594b9448e4138 \ + --hash=sha256:e585d530764c459cbd5d460aed0288807bb881f376ca9a20e653645217895961 \ + --hash=sha256:e76e6638ead4a7d93262a24218f0ff3ff74de6b6c823b7e19dccb31b6a481978 \ + --hash=sha256:ebfc2f885cafda076c31ae30fa0dd81e7e919ec34059a88d3018ed66e83fcce3 \ + --hash=sha256:f5797a39933a3d41526da60856735e6684b2b71a8ca99d5f79555ca121be2f4b \ + --hash=sha256:f7e5fc5e124200b19a14be33fb0099e956e6ebb5e25d287b0829ef0a78ed76c7 \ + --hash=sha256:fb350e31e55211fec8ddc89fc0256f3b9bc3b44b68a8bde1cf44b3b4e80c0e42 cryptography==3.1 \ --hash=sha256:10c9775a3f31610cf6b694d1fe598f2183441de81cedcf1814451ae53d71b13a \ --hash=sha256:180c9f855a8ea280e72a5d61cf05681b230c2dce804c48e9b2983f491ecc44ed \ diff --git a/contrib/deterministic-build/requirements-hw.txt b/contrib/deterministic-build/requirements-hw.txt index 7ee50bae6..04c62290e 100644 --- a/contrib/deterministic-build/requirements-hw.txt +++ b/contrib/deterministic-build/requirements-hw.txt @@ -4,8 +4,8 @@ base58==2.0.1 \ bitbox02==4.1.0 \ --hash=sha256:1af95952d67b74c80ccc0588e0aee983c764960da637bd24bc41a1cb89d5e127 \ --hash=sha256:73a35594162f32897dd2b1880f0cfaa42922acd1c2d7f4cf3d94b8333329c931 -btchip-python==0.1.30 \ - --hash=sha256:6869c67a712969ae86af23617f6418049076626f8a8c34d1000b1c58a9702ad7 +btchip-qtum==0.1.30.1 \ + --hash=sha256:14595f19696c99f3d797aad5c44b8e4b777dbc8144910dd3ce93c535af21822a certifi==2020.6.20 \ --hash=sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3 \ --hash=sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41 diff --git a/contrib/osx/README.md b/contrib/osx/README.md index 372770044..2ad92b878 100644 --- a/contrib/osx/README.md +++ b/contrib/osx/README.md @@ -73,3 +73,8 @@ provide these env vars to the `make_osx` script: APPLE_ID_USER="me@email.com" \ APPLE_ID_PASSWORD="1234" \ ./contrib/osx/make_osx + + +#### Clean Environment + + rm -rf $HOME/Library/Python/3.7/lib/python/site-packages/ \ No newline at end of file diff --git a/contrib/requirements/requirements-binaries.txt b/contrib/requirements/requirements-binaries.txt index e6f64e585..07b95a783 100644 --- a/contrib/requirements/requirements-binaries.txt +++ b/contrib/requirements/requirements-binaries.txt @@ -1,2 +1,3 @@ PyQt5<5.15 cryptography>=2.1 +pycryptodomex>=3.7 diff --git a/electrum/crypto.py b/electrum/crypto.py index 3a0678535..04e1c78a7 100644 --- a/electrum/crypto.py +++ b/electrum/crypto.py @@ -42,16 +42,6 @@ else: HAS_PYAES = True -HAS_CRYPTODOME = False -try: - from Cryptodome.Cipher import ChaCha20_Poly1305 as CD_ChaCha20_Poly1305 - from Cryptodome.Cipher import ChaCha20 as CD_ChaCha20 - from Cryptodome.Cipher import AES as CD_AES -except: - pass -else: - HAS_CRYPTODOME = True - HAS_CRYPTOGRAPHY = False try: import cryptography @@ -66,6 +56,15 @@ else: HAS_CRYPTOGRAPHY = True +HAS_CRYPTODOME = False +try: + from Cryptodome.Cipher import ChaCha20_Poly1305 as CD_ChaCha20_Poly1305 + from Cryptodome.Cipher import ChaCha20 as CD_ChaCha20 + from Cryptodome.Cipher import AES as CD_AES +except: + pass +else: + HAS_CRYPTODOME = True if not (HAS_CRYPTODOME or HAS_CRYPTOGRAPHY): sys.exit(f"Error: at least one of ('pycryptodomex', 'cryptography') needs to be installed.")