| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
* password hash api rewritten to center around PasswordHash abstract class
* extended walkthrough and documentation for PasswordHash interface
* pared down the per-hash examples, added links to PasswordHash
* updates docs and warnings
|
|
|
|
|
|
| |
passlib.ifc.PasswordHash
(also had to make some tweaks to fix class repr due to ABCMeta)
|
|
|
|
| |
hashes
|
|
|
|
|
|
|
|
|
|
| |
* bsdi_crypt apparently available on openbsd 4.9
* typo fixes
* ConfigParser apparently only uses OrderedDict for >= PY27,
adjusted CryptContext test accordingly
* fixed test that depended on sha256_crypt.default_rounds
* handle os_crypt backend w/ no fallback (bcrypt)
* let _norm_rounds accept longs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* StaticHandler is now subclass of GenericHandler
- _calc_checksum() should be implemented instead of encrypt().
(compatibility stub added so old code should continue to work)
- _norm_hash() no longer needs to handle ->unicode conversion
- default from_string() contains a bunch of features,
including stripping a known prefix, etc.
* context kwds now pulled into constructor, so GenericHandler
supports context kwds properly; HasUserContext mixin added
to support common 'user' context kwd
* identify_regexp & identify_prefix removed, functionality
rolled into default GenericHandler.identify() implementation.
- default identify checks _hash_regex as potential way to identify hashes
* HasStubChecksum removed, functionality rolled into GenericHandler
* HasRawChecksum now just sets a flag, functionality moved into GenericHandler
* HasManyIdents._parse_ident() helper added to valid & split identifier
from hashes.
* GenericHandler._norm_checksum() is now strict about unicode / bytes
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
* safe_crypt() improved - accepts unicode/bytes for salt, checks for NULL, returns None on failure
* added test_crypt() wrapper to simplify backend checks.
* removed native=True from most to_string() implementations, unused now.
* updated UTs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
aliases kept for now)
|
|
|
|
|
|
|
|
|
|
|
| |
* new utils.Base64Engine() provides flexible class for encoding arbitrary base64 charmaps.
it should also be a bit faster than the old h64 module.
* predefined 'h64' instance has mostly the same methods as the old h64 module
which it takes the place off - so imports should be unaffected.
(the only the exception of the xxx_dc_xxx methods, which now use the 'h64big' instance)
* replaced utils._blowfish base64 encoding with custom Base64Engine instance
to reduce code duplication.
* more through unittests for Base64Engine.
|
|
|
|
| |
of throwing ValueError for some handlers
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
compat.u
|
|
|
|
|
|
|
|
| |
this distinguishes the types, so that for isinstance() tests...
* 'unicode' always means the unicode type
* 'bytes' always means the bytes type
* 'str' always means the native string type
|
|
|
|
| |
H64_CHARS
|
| |
|
| |
|
|
|
|
| |
pdkdf2_sha1 for compat w/ existing hashes
|
|
|
|
| |
document ldap CRYPT hashes
|
|
|
|
| |
too implicit
|
|
|
|
|
|
| |
checksum_charset->checksum_chars.
* these were never documented or used externally, so no deprecated aliases left.
|
|
|
|
|
|
|
|
|
|
|
| |
(min|max|default)_salt_size
* part of finalization of password hash api, these should not change name again
* the names are rather ambiguous, "_size" makes it clearer what they mean
* also renamed salt_charset -> salt_chars for the same reason
* for applications that were reading old attributes, left aliases in place
which will issue a warning when access - these will be removed in passlib 1.5
*
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* converted all ExtendedHandler & MultiBackendHandler subclasses
to use GenericHandler + appropriate mixins.
* converted most SimpleHandler subclasses to use StaticHandler.
* changed some hashes to parse_mc2/mc3 methods:
md5_crypt, apr_md5_crypt, most pbkdf2 hashes, sha1_crypt
* changed most hashes to coerce unicode hash strings -> ascii
* changed some internal attribute names for consistency
|
|
|
|
| |
Atlassian (eg Jira's cwd_user table)
|
|
|
|
| |
compat, changes made by 2to3)
|
|
* pbkdf2_sha1, pbkdf2_sha256, pbkdf2_sha512 -- 3 custom schemes defined by passlib
* dlitz_pbkdf2_sha1 -- Dwayne Litzenberger's PBKDF2 crypt
* grub_pbkdf2_sha512 -- Grub2's PBKDF2 hash format
* two util support functions: adapted_b64_(encode|decode)
* UTs and docs for all of the above
|