diff options
author | Ruben Pollan <meskio@sindominio.net> | 2016-02-11 01:20:33 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2016-02-11 01:20:33 +0100 |
commit | f2fa5804879f6d7614d05537b042be3586958e7f (patch) | |
tree | faba24b3afe00ac8e664b7a465ee32f96da73ddf /src/leap/mail/walk.py | |
parent | 51e6f7a5eb8cb3e5bd69e4c55c5360b37a6f2111 (diff) |
[feat] Use cryptography instead of pycryptopp to reduce dependencies.
* Resolves: #7889
Diffstat (limited to 'src/leap/mail/walk.py')
-rw-r--r-- | src/leap/mail/walk.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/leap/mail/walk.py b/src/leap/mail/walk.py index 7be1bb8..8693bdd 100644 --- a/src/leap/mail/walk.py +++ b/src/leap/mail/walk.py @@ -17,13 +17,16 @@ """ Utilities for walking along a message tree. """ -from pycryptopp.hash import sha256 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes from leap.mail.utils import first def get_hash(s): - return sha256.SHA256(s).hexdigest() + digest = hashes.Hash(hashes.SHA256(), default_backend()) + digest.update(s) + return digest.finalize().encode("hex").upper() """ |