summaryrefslogtreecommitdiffstats
path: root/Lib/hashlib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-06 18:22:28 (GMT)
committerChristian Heimes <christian@python.org>2016-09-06 18:22:28 (GMT)
commit39093e9e6836b98dc67979e4e888e4bc639caa07 (patch)
treec5be5c5ad31e520580ca9f30d019c47cebb66886 /Lib/hashlib.py
parentac041c0aa721e2672dfb684562b08ad5465b76b1 (diff)
downloadcpython-39093e9e6836b98dc67979e4e888e4bc639caa07.zip
cpython-39093e9e6836b98dc67979e4e888e4bc639caa07.tar.gz
cpython-39093e9e6836b98dc67979e4e888e4bc639caa07.tar.bz2
Issue #27928: Add scrypt (password-based key derivation function) to hashlib module (requires OpenSSL 1.1.0).
Diffstat (limited to 'Lib/hashlib.py')
-rw-r--r--Lib/hashlib.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index 316cece..348ea14 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -202,6 +202,12 @@ except ImportError:
return dkey[:dklen]
+try:
+ # OpenSSL's scrypt requires OpenSSL 1.1+
+ from _hashlib import scrypt
+except ImportError:
+ pass
+
for __func_name in __always_supported:
# try them all, some may not work due to the OpenSSL