| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
"native_string_types" aliases
|
| |
|
|
|
|
|
|
|
|
|
| |
scheduled
for removal in v1.8.
this removes CryptPolicy, unix_fallback, some old HtpasswdFile methods,
and more. tests were updated as well. see history/1.8 for a complete list.
|
| |
|
|
|
|
|
| |
(a border case anyways), and hashlib or fastpbkdf2 are much better choices
for this use case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and moved them to a separate passlib.crypto subpackage.
along with this move, made a few api cleanups:
* unified all code that's looking up hashes
to use new passlib.crypto.lookup_hash() wrapper, which takes
care of hash name normalization, loading fallback implementations,
and alg metadata inspection, all hidden behind a memoized function.
* deprecated pbkdf2() in favor of pbkdf2_hmac() -- only real use,
and new signature matches stdlib function. additionally,
this version is a bit faster, due to some assumptions that
can be made due to the PRF always being HMAC based.
* added compile_hmac() helper which does an even more efficient
job of pre-compiling a keyed HMAC function; this helped speed up pbkdf2 a bit more.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* test_handlers: fix py3 u() compat issue
* test_totp: clean norm_hash_name() caches so warnings repeat per-test,
added/fixed some warnings checks.
* HandlerCase: HasRounds.using() test: hack so bsdi_crypt can pass
(the 'odd rounds only' was playing havoc w/ the test's expectations)
* HandlerCase: effective_rounds() / effective_ident() helpers
now unwrap PrefixWrappers first; wrappers aren't callable like classes.
* HandlerCase: HasRounds.using() test: don't check min_rounds-1
if min_rounds is 0.
* HandlerCase: multithreaded fuzz test -- detect & log errors if stalled thread,
rather than main thread stalling forever. reduced thread count down to 10.
* reset_warning_filter() context manager -- simplified __exit__() cleanup code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
support;
as well as PyPy 1.x and Jython 2.5.
shims removed
-------------
* b() shim replaced with b'' (py25)
* 'bytes' alias no longer needed (py25)
* callable() shim no longer needed (py30,31)
* PY_MIN_32 flag replaced with PY3 flag (py30,31)
* removed 'abc' module stub used by passlib.ifc (py25)
* removed chain_from_iterable() backport (py25)
* tests: removed catch_warnings() backport,
replaced refs with real warnings.catch_warnings() (py25)
* tests: removed unittest2 backports (py25, py30, py31) --
now throw hard error if unittest2 not present under py26
(the only release remaining which lacks the unittest2 features)
* removed SUPPORTS_DIR_METHOD conditional (py25, pypy 1.x)
* some other minor workarounds
other
-----
* added check in passlib.compat which now throws error telling user
version isn't supported (to prevent spurious errors later)
|
|
|
|
|
| |
* updated sha1_crypt to use get_keyed_prf(), should be ~10% faster
* documented get_hash_info() and get_keyed_prf()
|
| |
|
| |
|
|
|
|
| |
comment 7)
|
| |
|
|
|
|
|
|
|
| |
* also added get_hash_info(), get_keyed_prf() helpers
(which still need their own docs & unittests)
* a few more tweaks to simplify code paths in pbkdf2.py
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
hashes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
I previously thought
|
| |
|
|
|
|
| |
classes to make filtering easier
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
this commit just fixes some error raises
|
| |
|
|
|
|
| |
complicates things - kdfs should all use bytes only.
|
|
|
|
|
|
|
| |
* kdfs, md4, and utils proper
* updated UTs
* added to_native_str helper
* added some UTs for new to_bytes / to_unicode etc methods
|
|
|
|
|
|
|
| |
* renamed _resolve_prf() to get_prf(), documented interface
* added pbkdf1 support
* added 'encoding' kwd to pbkdf1 & pbkdf2, for easier handling of unicode inputs
*
|
| |
|
| |
|
|
|
|
| |
compat, changes made by 2to3)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
============================
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
=============
* 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
|
| |
|
| |
|
|
=====================
* 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
|