Issue #18582: Add 'pbkdf2_hmac' to the hashlib module.

This commit is contained in:
Christian Heimes 2013-10-13 00:52:43 +02:00
parent 3892419a7a
commit e92ef13b0a
6 changed files with 280 additions and 0 deletions

View file

@ -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.