commit | 39093e9e6836b98dc67979e4e888e4bc639caa07 | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@python.org> | Tue Sep 06 20:22:28 2016 +0200 |
committer | Christian Heimes <christian@python.org> | Tue Sep 06 20:22:28 2016 +0200 |
tree | c5be5c5ad31e520580ca9f30d019c47cebb66886 | |
parent | ac041c0aa721e2672dfb684562b08ad5465b76b1 [diff] [blame] |
Issue #27928: Add scrypt (password-based key derivation function) to hashlib module (requires OpenSSL 1.1.0).
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 @@ 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