summaryrefslogtreecommitdiff
path: root/Lib/hashlib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-10-13 00:52:43 +0200
committerChristian Heimes <christian@cheimes.de>2013-10-13 00:52:43 +0200
commite92ef13b0add24cff6b3eba2f0b52a7833195a8c (patch)
tree8ff77db5dc84b7b87ceafe5e5bc0da56e431315a /Lib/hashlib.py
parent3892419a7a8321bef27262b0d8f0a22305830ce5 (diff)
downloadcpython-git-e92ef13b0add24cff6b3eba2f0b52a7833195a8c.tar.gz
Issue #18582: Add 'pbkdf2_hmac' to the hashlib module.
Diffstat (limited to 'Lib/hashlib.py')
-rw-r--r--Lib/hashlib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index a1bd8b2de8..73882d1872 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -147,6 +147,14 @@ except ImportError:
new = __py_new
__get_hash = __get_builtin_constructor
+# PBKDF2 requires OpenSSL 1.0+ with HMAC and SHA
+try:
+ from _hashlib import pbkdf2_hmac
+except ImportError:
+ pass
+else:
+ __all__ += ('pbkdf2_hmac',)
+
for __func_name in __always_supported:
# try them all, some may not work due to the OpenSSL
# version not supporting that algorithm.