| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
realized can do this now that we're requiring python3 >= 3.3.
had to keep u() helper around for u(r"") instances, since py3 doesn't have ur"".
but switched it to use ascii decoding for py2, to make sure things are clean.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.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().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
helper functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
* added str_to_[ub]ascii to wrap hexdigest() calls
* fixed some h64big calls I missed
* some py3 fixes
* removed utils.compat.aliases, using overlay
to replace real compat module instead
(to agree w/ imports already in code)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
override
* enhanced StaticHandler.verify method to normalize hash unicode/bytes better
* changed various StaticHandler-derived classes to use _norm_hash() instead of re-implementing verify()
* oracle, postgres hashes now derive from StaticHandler instead of object.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
compat, changes made by 2to3)
|
|
===========================
Renamed all references from password hash "driver" -> password hash "handler", to be more consistent with existing phrasing.
This also required rearranging quite a lot of modules.
|