From b8b942d0c077db5d6adda32660ea3916d0e0533e Mon Sep 17 00:00:00 2001 From: Milan Stute Date: Tue, 20 Aug 2019 10:53:46 +0200 Subject: [PATCH] Remove pycrypto dependency (fixes #10) --- opendrop/util.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opendrop/util.py b/opendrop/util.py index 9f0eca6..98c5934 100644 --- a/opendrop/util.py +++ b/opendrop/util.py @@ -27,7 +27,7 @@ import os import platform import plistlib import socket -from Crypto.Hash import SHA, SHA256 +import hashlib from PIL import Image, ExifTags from libarchive import ffi from libarchive.entry import new_archive_entry, ArchiveEntry @@ -121,8 +121,8 @@ class AirDropUtil: valid_date = datetime.datetime.now() - datetime.timedelta(days=3) valid_date_string = valid_date.strftime('%Y-%m-%dT%H:%M:%SZ') - emails_hashed = [SHA256.new(email.encode('utf-8')).hexdigest() for email in config.email] - phone_numbers_hashed = [SHA256.new(phone_number.encode('utf-8')).hexdigest() for phone_number in config.phone] + emails_hashed = [hashlib.sha256(email.encode('utf-8')).hexdigest() for email in config.email] + phone_numbers_hashed = [hashlib.sha256(phone_number.encode('utf-8')).hexdigest() for phone_number in config.phone] # Get the common name of the TLS certificate with open(tls_cert, 'rb') as cert_file: diff --git a/setup.py b/setup.py index 06b38c9..b36b972 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setup( package_data={ 'opendrop': ['certs/*.pem'] }, - install_requires=['pycrypto', 'requests', 'fleep', 'netifaces', 'Pillow', + install_requires=['requests', 'fleep', 'netifaces', 'Pillow', 'requests_toolbelt', 'ctypescrypto', 'libarchive-c'], entry_points={ 'console_scripts': [