summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-05-31 12:39:29 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2017-05-31 18:51:22 +0200
commit95687c3137d7ea7a4a64d373e1e5199061ee38e3 (patch)
treeaa4afc5ed72df4c28aaa19b6092334da141c98bb
parent6aa1aeba607e59fb45af961fb74e9c1844694851 (diff)
[bug] fix deprecated import of cryptography multibackend
- Resolves: #8910
-rw-r--r--pkg/requirements.pip1
-rw-r--r--setup.py1
-rw-r--r--src/leap/bitmask/core/uuid_map.py8
-rw-r--r--src/leap/bitmask/mail/walk.py6
4 files changed, 7 insertions, 9 deletions
diff --git a/pkg/requirements.pip b/pkg/requirements.pip
index 80dca0b..4fd647a 100644
--- a/pkg/requirements.pip
+++ b/pkg/requirements.pip
@@ -1,3 +1,4 @@
+cryptography
twisted
colorama
zope.interface
diff --git a/setup.py b/setup.py
index 76fb4a5..c68278e 100644
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@ import versioneer
required = [
'twisted>=14.0.0',
+ 'cryptography',
'zope.interface',
'service-identity',
'colorama',
diff --git a/src/leap/bitmask/core/uuid_map.py b/src/leap/bitmask/core/uuid_map.py
index 262e3db..e7d02a3 100644
--- a/src/leap/bitmask/core/uuid_map.py
+++ b/src/leap/bitmask/core/uuid_map.py
@@ -30,13 +30,11 @@ from leap.common.config import get_path_prefix
IS_WIN = platform.system() == "Windows"
if IS_WIN:
+
import socket
from cryptography.fernet import Fernet
- from cryptography.hazmat.backends.multibackend import MultiBackend
- from cryptography.hazmat.backends.openssl.backend \
- import Backend as OpenSSLBackend
- crypto_backend = MultiBackend([OpenSSLBackend()])
-
+ from cryptography.hazmat.backends import default_backend
+ crypto_backend = default_backend()
MAP_PATH = os.path.join(get_path_prefix(), 'leap', 'uuids')
diff --git a/src/leap/bitmask/mail/walk.py b/src/leap/bitmask/mail/walk.py
index 6c9fc38..e25ea16 100644
--- a/src/leap/bitmask/mail/walk.py
+++ b/src/leap/bitmask/mail/walk.py
@@ -20,14 +20,12 @@ store.
"""
from email.parser import Parser
-from cryptography.hazmat.backends.multibackend import MultiBackend
-from cryptography.hazmat.backends.openssl.backend import (
- Backend as OpenSSLBackend)
from cryptography.hazmat.primitives import hashes
+from cryptography.hazmat.backends import default_backend
from leap.bitmask.mail.utils import first
-crypto_backend = MultiBackend([OpenSSLBackend()])
+crypto_backend = default_backend()
_parser = Parser()