summaryrefslogtreecommitdiff
path: root/passlib/utils/pbkdf2.py
Commit message (Collapse)AuthorAgeFilesLines
* clarify behavior for secret=None and hash=NoneEli Collins2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * passing a non-string secret or non-string hash to any CryptContext or handler method will now reliably result in a TypeError. previously, passing hash=None to many handler identify() and verify() methods would return False, while others would raise a TypeError. other handler methods would alternately throw ValueError or TypeError when passed a value that wasn't unicode or bytes. the various CryptContext methods also behaved inconsistently, depending on the behavior of the underlying handler. all of these behaviors are gone, they should all raise the same TypeError. * redid many of the from_string() methods to verify the hash type. * moved secret type & size validation to GenericHandler's encrypt/genhash/verify methods. this cheaply made the secret validation global to all hashes, and lets _calc_digest() implementations trust that the secret is valid. * updated the CryptContext and handler unittests to verify the above behavior is adhered to.
* fixed issue 29 - m2crypto crash may be triggered by keylen > 32, not > 41 as ↵Eli Collins2012-04-091-5/+7
| | | | I previously thought
* cleanup of scram hash; improved norm_digest_name() and moved it to utils.pbkdf2Eli Collins2012-03-101-1/+104
|
* split exceptions/warnings to separate module; added some additional warning ↵Eli Collins2012-01-181-1/+3
| | | | classes to make filtering easier
* import cleanupsEli Collins2012-01-181-3/+2
| | | | | | | | | | | | | | | * moved bytes compat functions from utils to utils.compat (bord, bjoin, bjoin_ints, bjoin_elems, ujoin) * renamed bord -> belem_ord for clarify * a bunch of to_native_str() always use ascii, and have fixed input types (always bytes or always unicode). these don't need overhead of to_native_str(), so replaced those calls with two new funcs: compat.bascii_to_str() / compat.uascii_to_str() * cleaned up a lot of imports from utils/utils.compat to pull from correct module * simplified the to_string() logic of a bunch of handlers to reduce unicode<->byte transitions
* lots of work on scram hashEli Collins2012-01-091-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | handler ------- * added 'scram' to default registry list * handler 'algs' keyword now parsed & validated correctly * digest names normalized -> IANA spec * saslprep() integrated into code * added config string format related ------- * added documentation (still needs cleaning up though) * added majority of UTs, still need to add a few edge cases other ----- * redid context->handler deprecation link - code now looks for handler._deprecated_detector(settings) to generate a callable, should be more efficient, and allow errors to be throw at bind-time instead of call-time. * pbkdf2() function now treats keylen = -1 as request for keylen = PRF digest size.
* deprecated to_hash_str, replaced all instances with to_native_strEli Collins2011-12-281-3/+3
| | | | | | decided that to_hash_str will always return native string, feature of hashes being returned as unicode under python 2 is better done through a CryptContext option.
* added compat.aliased lazy-loading module, aliases for BytesIO/StringIOEli Collins2011-12-061-6/+1
|
* replaced (int,long) instance checks with compat.int_typesEli Collins2011-12-061-4/+4
|
* added callable shim for 3.0-3.1Eli Collins2011-12-061-1/+1
|
* replaced xrange() instances with compat.irange() aliasEli Collins2011-12-061-1/+2
|
* branch exploring feasibility of removing need for 2to3Eli Collins2011-12-061-1/+2
| | | | this commit just fixes some error raises
* misc documentation tweaksEli Collins2011-06-301-18/+20
|
* removed 'encoding' kwd from pbkdf1 / pbkdf2 - unused, uneeded, and ↵Eli Collins2011-06-201-13/+10
| | | | complicates things - kdfs should all use bytes only.
* rest of utils now py3 compatEli Collins2011-06-171-34/+22
| | | | | | | * kdfs, md4, and utils proper * updated UTs * added to_native_str helper * added some UTs for new to_bytes / to_unicode etc methods
* kdf enhancementsEli Collins2011-06-021-53/+185
| | | | | | | * renamed _resolve_prf() to get_prf(), documented interface * added pbkdf1 support * added 'encoding' kwd to pbkdf1 & pbkdf2, for easier handling of unicode inputs *
* minor additions to documentationEli Collins2011-04-061-10/+10
|
* removed a bunch of "L" suffixes from ints (per 2to3)Eli Collins2011-03-281-1/+1
|
* replaced "raise exc, msg" with "raise exc(msg)" everywhere (working on py3k ↵Eli Collins2011-03-281-5/+5
| | | | compat, changes made by 2to3)
* misc bugfixes & tweaks for win32 compatEli Collins2011-03-251-3/+9
|
* bugfixes, tweaks, test casesEli Collins2011-03-181-1/+1
| | | | | | | | | | | | | | | | | ============================ * now at 99% coverage * changed some error types * bugfix to min_verify_time code * tests for registry, some cryptcontext border cases * ldap hash tests * tests for rest of utils * tests for skeleton hash classes in passlib.utils.drivers * moved validate_class code from skeleton hash classes to HandlerCase main things still needing testing: * category support for CryptContext/Policy * some bits of registry
* coverage workEli Collins2011-03-181-1/+1
| | | | | | | | | | | ============= * restored "default" mode for set_backend() * bugfix: HandlerCase now sets backend explicitly, incorrect backend checks were previously happening * added UT for genhash(secret, None) * enabled HandlerCase.supports_unicode for all hashes * added some needed test cases revealed by coverage check * added "pragma: no cover" for a select few branches that don't need testing * all UTs pass, 92% coverage
* converted NTHash, PostgresMD5, SHA256Crypt, SunMD5Crypt to classesEli Collins2011-02-141-1/+20
|
* import cleanupsEli Collins2011-01-191-1/+1
|
* rearranging some moreEli Collins2011-01-191-0/+148
===================== * moved unix style algorithms into passlib.unix package * renamed unix-crypt to des-crypt * moved a bunch of utils into new utils pacakge * NOTE: imports currently broken