summaryrefslogtreecommitdiff
path: root/passlib/handlers/phpass.py
Commit message (Collapse)AuthorAgeFilesLines
* retuned default_rounds for a few hashes based on benchmarksEli Collins2012-04-171-1/+1
|
* utils.handlers framework reworked; removed a bunch of boilerplate codeEli Collins2012-03-091-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* renamed calc_checksum() -> _calc_checksum(), hiding the last of the private ↵Eli Collins2012-02-081-1/+1
| | | | methods of most handlers
* large refactor of GenericHandler internalsEli Collins2012-02-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* import cleanupsEli Collins2012-01-181-3/+4
| | | | | | | | | | | | | | | * 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
* renamed the utils.handlers.XX_CHARS constants to match utils.XX_CHARS (old ↵Eli Collins2012-01-181-2/+2
| | | | aliases kept for now)
* clarified border case where verify() accepted configuration strings instead ↵Eli Collins2012-01-091-1/+1
| | | | of throwing ValueError for some handlers
* deprecated to_hash_str, replaced all instances with to_native_strEli Collins2011-12-281-2/+2
| | | | | | 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.
* fixed conversion typoEli Collins2011-12-061-1/+1
|
* ran a custom 2to3 fixer to replace all u"" with u() and add an import from ↵Eli Collins2011-12-061-6/+6
| | | | compat.u
* added compat.unicode imports in a number of placesEli Collins2011-12-061-0/+1
| | | | | | | | 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
* minor documentation updatesEli Collins2011-10-071-1/+1
|
* GenericHandler.checksum_chars now defaults to ``None``, instead of implicit ↵Eli Collins2011-06-201-0/+1
| | | | H64_CHARS
* converted handlers to py3 compat: fshp, mysql, oracle, postgres, roundup, phpassEli Collins2011-06-171-10/+14
|
* changed HasSalt to require explicit salt_chars; defaulting to H64_CHARS was ↵Eli Collins2011-04-251-0/+1
| | | | too implicit
* api change - renaming (min|max|default)_salt_chars attributes -> ↵Eli Collins2011-04-251-1/+1
| | | | | | | | | | | (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 most handlers to use new helper classes.Eli Collins2011-04-051-40/+18
| | | | | | | | | | * 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
* replaced "raise exc, msg" with "raise exc(msg)" everywhere (working on py3k ↵Eli Collins2011-03-281-4/+4
| | | | compat, changes made by 2to3)
* big rename: changed base handler class namesEli Collins2011-03-221-2/+2
| | | | | | | | ============================================ renamed the classes in passlib.utils.handlers, for clarity in code: * BaseHash -> SimpleHandler * ExtHash -> ExtendedHandler * BackendExtHash -> MultiBackendHandler
* big rename: driver->handlerEli Collins2011-03-221-0/+151
=========================== 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.