summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-03-09 12:54:22 -0400
committerKali Kaneko <kali@leap.se>2016-03-09 12:54:22 -0400
commit6cc3079cbce82ad77575567ffa5a25da9d45e7bc (patch)
treeeda361a36da82103e6b73c907a86f3ee3b4bdef4 /mail
parentd83b04cfb0969daae26d36ef36907f136fd6f261 (diff)
[bug] specify openssl backend explicitely
for some reason, available_backends does not work inside a frozen PyInstaller binary. - Resolves: #7952
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/walk.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mail/src/leap/mail/walk.py b/mail/src/leap/mail/walk.py
index 8693bdd2..b2aa3040 100644
--- a/mail/src/leap/mail/walk.py
+++ b/mail/src/leap/mail/walk.py
@@ -17,14 +17,16 @@
"""
Utilities for walking along a message tree.
"""
-from cryptography.hazmat.backends import default_backend
+from cryptography.hazmat.backends.multibackend import MultiBackend
+from cryptography.hazmat.backends.openssl.backend import Backend as OpenSSLBackend
from cryptography.hazmat.primitives import hashes
from leap.mail.utils import first
def get_hash(s):
- digest = hashes.Hash(hashes.SHA256(), default_backend())
+ backend = MultiBackend([OpenSSLBackend()])
+ digest = hashes.Hash(hashes.SHA256(), backend)
digest.update(s)
return digest.finalize().encode("hex").upper()