From e92ef13b0add24cff6b3eba2f0b52a7833195a8c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 13 Oct 2013 00:52:43 +0200 Subject: Issue #18582: Add 'pbkdf2_hmac' to the hashlib module. --- Lib/hashlib.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Lib/hashlib.py') 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. -- cgit v1.2.1