From 34be588887d1ae1db6e6972296401378b71e7be9 Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 25 Jan 2021 11:55:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4`pycryptodome`?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8C=85=E5=AE=89=E8=A3=85(=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA`pycryptodome`=E5=92=8C`pycrypto`=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8C=85=E7=9B=AE=E5=BD=95=E5=86=B2=E7=AA=81);=E5=8F=AA?= =?UTF-8?q?=E5=AE=89=E8=A3=85=20`pycryptodomex`=E4=BE=9D=E8=B5=96=E5=8C=85?= =?UTF-8?q?;=20=E4=BF=AE=E6=94=B9=20`from=20crypto`=20=E4=B8=BA=20`from=20?= =?UTF-8?q?cryptodome`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/utils.py | 6 +++--- apps/common/utils/crypto.py | 6 +++--- requirements/requirements.txt | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/authentication/utils.py b/apps/authentication/utils.py index f6750a73d..f8571d6d7 100644 --- a/apps/authentication/utils.py +++ b/apps/authentication/utils.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # import base64 -from Crypto.PublicKey import RSA -from Crypto.Cipher import PKCS1_v1_5 -from Crypto import Random +from Cryptodome.PublicKey import RSA +from Cryptodome.Cipher import PKCS1_v1_5 +from Cryptodome import Random from common.utils import get_logger diff --git a/apps/common/utils/crypto.py b/apps/common/utils/crypto.py index 31991c93c..6d8cbb10c 100644 --- a/apps/common/utils/crypto.py +++ b/apps/common/utils/crypto.py @@ -1,7 +1,7 @@ import base64 -from Crypto.Cipher import AES -from Crypto.Util.Padding import pad -from Crypto.Random import get_random_bytes +from Cryptodome.Cipher import AES +from Cryptodome.Util.Padding import pad +from Cryptodome.Random import get_random_bytes from django.conf import settings diff --git a/requirements/requirements.txt b/requirements/requirements.txt index f2f3a1ee5..0738911c1 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -53,8 +53,7 @@ Pillow==7.1.0 pyasn1==0.4.8 pycparser==2.19 pycrypto==2.6.1 -pycryptodome==3.9.7 -pycryptodomex==3.9.7 +pycryptodomex==3.9.9 pyotp==2.2.6 PyNaCl==1.2.1 python-dateutil==2.6.1