diff options
Diffstat (limited to 'passlib/utils/pbkdf2.py')
-rw-r--r-- | passlib/utils/pbkdf2.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/passlib/utils/pbkdf2.py b/passlib/utils/pbkdf2.py index 273143b..d9bd083 100644 --- a/passlib/utils/pbkdf2.py +++ b/passlib/utils/pbkdf2.py @@ -6,20 +6,14 @@ maybe rename to "kdf" since it's getting more key derivation functions added. #============================================================================= # imports #============================================================================= -from __future__ import division # core import logging; log = logging.getLogger(__name__) # site # pkg from passlib.exc import ExpectedTypeError -from passlib.utils.decor import deprecated_function -from passlib.utils.compat import native_string_types -from passlib.crypto.digest import norm_hash_name, lookup_hash, pbkdf1 as _pbkdf1, pbkdf2_hmac, compile_hmac +from passlib.crypto.digest import lookup_hash, pbkdf1 as _pbkdf1, pbkdf2_hmac, compile_hmac # local __all__ = [ - # hash utils - "norm_hash_name", - # prf utils "get_prf", @@ -38,13 +32,6 @@ warn("the module 'passlib.utils.pbkdf2' is deprecated as of Passlib 1.7, " DeprecationWarning) #============================================================================= -# hash helpers -#============================================================================= - -norm_hash_name = deprecated_function(deprecated="1.7", removed="1.8", func_module=__name__, - replacement="passlib.crypto.digest.norm_hash_name")(norm_hash_name) - -#============================================================================= # prf lookup #============================================================================= @@ -97,7 +84,7 @@ def get_prf(name): global _prf_cache if name in _prf_cache: return _prf_cache[name] - if isinstance(name, native_string_types): + if isinstance(name, str): if not name.startswith(_HMAC_PREFIXES): raise ValueError("unknown prf algorithm: %r" % (name,)) digest = lookup_hash(name[5:]).name @@ -183,7 +170,7 @@ def pbkdf2(secret, salt, rounds, keylen=None, prf="hmac-sha1"): This has been deprecated in favor of :func:`passlib.crypto.digest.pbkdf2_hmac`, and will be removed in Passlib 2.0. *Note the call signature has changed.* """ - if callable(prf) or (isinstance(prf, native_string_types) and not prf.startswith(_HMAC_PREFIXES)): + if callable(prf) or (isinstance(prf, str) and not prf.startswith(_HMAC_PREFIXES)): raise NotImplementedError("non-HMAC prfs are not supported as of Passlib 1.7") digest = prf[5:] return pbkdf2_hmac(digest, secret, salt, rounds, keylen) |