From d448fbe951c823d2a79aee6292bb942afa2ee6dc Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 18 Jul 2017 09:54:00 -0400 Subject: [bug] use scrypt lib if an old cryptography found --- src/leap/soledad/client/_scrypt.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/leap') diff --git a/src/leap/soledad/client/_scrypt.py b/src/leap/soledad/client/_scrypt.py index 2de3ab5e..03dcab40 100644 --- a/src/leap/soledad/client/_scrypt.py +++ b/src/leap/soledad/client/_scrypt.py @@ -15,11 +15,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from cryptography.hazmat.backends.interfaces import ScryptBackend -from cryptography.hazmat.backends import default_backend - -backend = default_backend() -OPENSSL_HAS_SCRYPT = isinstance(backend, ScryptBackend) +try: + from cryptography.hazmat.backends.interfaces import ScryptBackend + from cryptography.hazmat.backends import default_backend + backend = default_backend() + OPENSSL_HAS_SCRYPT = isinstance(backend, ScryptBackend) +except ImportError: + OPENSSL_HAS_SCRYPT = False if OPENSSL_HAS_SCRYPT: from cryptography.hazmat.primitives.kdf.scrypt import Scrypt -- cgit v1.2.3