summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-07-18 09:54:00 -0400
committerKali Kaneko <kali@leap.se>2017-07-18 09:56:42 -0400
commitd448fbe951c823d2a79aee6292bb942afa2ee6dc (patch)
tree580b5d4c955e2c4b0dabda2ded5aa871728b5e9b /src/leap/soledad
parente0786b9ba6d16ed4895d66af5f5a6c7f78edbf4f (diff)
[bug] use scrypt lib if an old cryptography found
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/client/_scrypt.py12
1 files changed, 7 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
-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