| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
and not worth the amount of code it requires to support it.
* stripped out vary_rounds from all internal presets
* added deprecation warning if it's ever used
|
| |
|
|
| |
prevents some spurious test failures when under erratic system load
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.encrypt()
----------
hash.encrypt() & context.encrypt() have been renamed to .hash().
this should take care of the long-standing issue 21 (the poor naming of .encrypt).
per docs, legacy aliases will remain in place until passlib 2.0.
.genhash() / .genconfig()
-------------------------
taking advantage of this reorganization to also deprecate .genconfig()
and .genhash() -- they're not really useful in a modern system,
nor as needed for historical support as initially thought:
.genconfig() will be retired completely in passlib 2.0;
.genhash() is rolled into the new .hash() method along with .encrypt().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* split generate() into genword() & genphrase() --
APIs are just too different to keep combined.
* renamed internal calc funcs to better reflect their purpose.
* commented out PhraseGenerator's min_chars code, can't confirm
it's doing correct thing.
* commented out password strength estimator, too half-baked.
* tried to simplify SequenceGenerator attributes.
* genword(): defined some base charsets to work with
* genphrase(): wordsets now stored uncompressed (not really that big,
and .whl will compress everything for transport).
* fleshed out UTs for genword() & genphrase()
* updated docs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |\ |
|
| | | |
|
| |\ \
| | |
| | |
| | | |
before 1.7 release)
|
| | | |
| | |
| | |
| | |
| | | |
* updated sha1_crypt to use get_keyed_prf(), should be ~10% faster
* documented get_hash_info() and get_keyed_prf()
|
| | | | |
|
| | | | |
|
| |/ / |
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
| |
against deprecated list (closes issue 39)
* also added some unittests to catch 3 cases covered in issue 39,
and some others as well.
|
| | |
|
| | |
|
| |
|
|
| |
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.
|
| |
|
|
| |
bunch of redundant code
|
| |
|
|
| |
messages
|
| |
|
|
|
|
|
| |
was using default policy to store recommended defaults for hashes,
but it only affects CryptContext objects, and users seem to frequent
using the handler objects directly - so going to store recommended
defaults in the handler from now on.
|
| |
|
|
| |
reliably
|
| |
|
|
| |
methods of most handlers
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strict keyword
--------------
* GenericHandler's "strict" keyword had poorly defined semantics;
replaced this with "use_defaults" and "relaxed" keywords.
Most handlers' from_string() method specified strict=True.
This is now the default behavior, use_defaults=True is enabled
only for encrypt() and genconfig(). relaxed=True is enabled
only for specific handlers (and unittests) whose code requires it.
This *does* break backward compat with passlib 1.5 handlers,
but this is mostly and internal class.
* missing required settings now throws a TypeError instead of
a ValueError, to be more in line with std python behavior.
* The norm_xxx functions provided by the GenericHandler mixins
(e.g. norm_salt) have been renamed to _norm_xxx() to reflect their
private nature; and converted from class methods to instance
methods, to simplify their call signature for subclassing.
misc
----
* rewrote GenericHandler unittests to use constructor only,
instead of poking into norm_salt/norm_rounds internals.
* checksum/salt charset checks speed up using set comparison
* some small cleanups to FHSP implementation
|
| |
|
|
| |
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
|
| | |
|
|
|
* refactoring policy kwd parsing & separation with crypt context
* internal record objects now part of context instead of policy.
* min_verify_time now handled by record objects, now optimized away entirely if not used.
* new interface to policy is currently private, will probably delay deprecated / revising
public interface until next release.
* creating policy & context objects is now 30% faster.
* shortened code path when calling context objects now 14% faster.
|