| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| | |
* patch django_argon2 so it only uses type "I" (to match django's behavior)
* patch it's UTs so they don't try to access hasher.type_values,
which is only present on base hasher.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
(fixes issue 95).
also added UT which checks behavior against locally-installed 'htpasswd' tool
(if available).
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* updated requirements to latest version of argon2_cffi & argon2pure;
though internal code should work with older versions.
* reworked argon2 module internals to handle wider range of hash types;
and make default customizable via "type" kwd.
* added reference vectors for "D" and "ID" hashes
|
| |
| |
| |
| |
| |
| | |
* UTs now has basic tests for parsehash() method
* argon2: excluded some settings kwd aliases from parsehash() call
|
| |
| |
| |
| |
| |
| | |
For all prior releases of passlib, `TOTP().to_uri()` would only output an
"issuer" parameter. Per the KeyURI spec, issuer should also be prepended
to the label for backward compatibility.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
crypt support may be present in libxcrypt
Author: Björn Esser <besser82@fedoraproject.org>
Date: Wed Mar 13 10:02:43 2019 +0100
https://src.fedoraproject.org/rpms/python-passlib/c/29e9641462291e812d7eb50d402e1b3a74c7a95e
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
implementation,
fixed a number of edge cases where we were generating the wrong thing.
tests
-----
* expanded test vectors, and ran them against an ASA 9.6 system.
marked out all vectors that were verified on 9.6 system.
found that user appending, and various size thresholds, weren't being
performed correctly by cisco_pix & cisco_asa -- certain hashes generated prior
to this will be "unverifiable" by a Cisco system.
* consolidated shared pix & asa tests into common base class.
* added test for "spoil_digest" codepath that's been added to cisco_pix _calc_digest()
(see below).
hashers
-------
* cisco_pix & cisco_asa now reject too-large passwords, and silently
return False when verifying them; to match Cisco behavior.
updated truncate policy flags to match new behavior.
* overhaul of _calc_checksum(), to fix identified issues,
lay out guesses & reasoning, and added some citations.
docs
----
* updated docs to list new algorithm, and conditions where the old code
would generate a bad hash.
* general cleanup of doc layout for these hashes
* updated "Cisco Hashes" section to give better listing of known hash formats.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
PasswordHash
-------------
* .truncate_size now used to indicate general "max password size";
* .truncate_error now defined for all hashers, indicates .hash() policy
* added .truncate_verify_reject as companion, indicates corresponding .verify() policy.
HandlerTestCase
---------------
* expanded test functions to check all combinations of truncation policy flags
* fixed fuzzer so it doesn't generate passwords which would throw PasswordSizeError.
|
| |
| |
| |
| | |
fix max_time_t to catch yet another utcfromtimestamp() error.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
will be removed completely in 1.8.
Rationale:
Aside from the arguments in issue 83, performed a timing analysis,
and decided harden_verify framework wasn't going to be easily workable
to prevent a timing attack anyways (see attached admin/plot_verify_timing.py script).
Changes:
* dummy_verify() has been kept around, but now uses .verify() against a dummy hash,
which is guaranteed to have correct timing (though wastes cpu cycles).
* Removed most harden_verify code, treating it as NOOP just like min_verify_time.
Similarly, removed most documentation references to.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* reworked backends so they're more pluggable.
* added _has_backend() helper for UTs to use, instead of _load_backend()
hack, which wasn't respecting dryrun flag.
this is mainly in preparation for issue 86: adding backend to support stdlib's
hashlib.scrypt().
|
|\ \
| |/ |
|
| |
| |
| |
| | |
due to system jitter.
|
| |
| |
| |
| | |
about invalid escape sequences (e.g. "\s")
|
| |
| |
| |
| | |
it was errorneously letting through; also workaround for python 3.6 issue 29346.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| | |
so RNG-dependant test failures are reproducible.
also upped # of samples for salt-generation test
so they aren't likely to *ever* fail (1/1000 was too low).
|
|/
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
passed settings keywords to .encrypt() / .hash().
* Enabled warn() call, made it a DeprecationWarning
* Audited test suite to
- remove any (unintended) calls to .hash(**settings)
- do assert check on warnings that *should* be there
|
|
|
|
| |
of places.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
ValueErrors,
modify PrefixWrapper to proxy _salt_is_bytes flag.
|
|
|
|
| |
submodule
|
| |
|
|
|
|
|
|
| |
now stored in public Hash.deprecated attr of returned hashers,
instead of monkeypatching Hash.needs_update().
this removes some cruft from a bunch of places.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
passlib.ext.django
------------------
* everything in .models relocated to the DjangoContextAdapter() class in .utils.
all that's left in models is a couple of hooks. This consolidates all
the model state into a single object, making it a lot easier to inspect
and optimize.
* consolidated a bunch of (undocumented) helper functions into DjangoTranslator()
class, which now acts as based for DjangoContextAdapter. Translator instances
handle converted passlib <-> django hashers, including caching speed-critical bits.
* wrapper class now has guards against wrong type of hasher being passed in
* wrapper class uses .using() instead of deprecated .hash(**kwds) format.
* updated and confirmed passing tests w/ django 1.10.3
passlib.ext.django tests
------------------------
* split test wrapper for django's internal tests (HashersTest) into separate file,
test_ext_django_source.py, to make it easier to run independantly.
reworked to use patchAttr(wraps=True) rather than less flexible ContextHook() hack
* tries to clean up HashersTest - adapts to django settings,
fixed code syncing .iteration settings back to passlib hashers,
* blocked out some django tests that we can't / won't pass,
documented reasons why.
other
-----
* CryptContext: added temporary hack to access unpatched Hasher.needs_update() method.
* PrefixWrapper: now proxies attr writes if it owns the wrapped hasher.
* test utils: added wrap=True support to patchAttr(), for wrapping arbitrary functions.
|
|
|
|
|
|
|
| |
* added django_argon2 wrapper & docs
* added method for PrefixWrapper to generically preserve custom attrs when
creating variants, so .django_name attr is persisted across .using() calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in reproducible manner.
* added TestCase.getRandom() helper, which creates RNG initialized
from ${RANDOM_TEST_SEED} or ${PYTHONHASHSEED} when possible,
and logs the seed so that exact test can be reproduced in future.
* replaced all test references to 'passlib.utils.rng' or other random source
with TestCase().getRandom() call.
* once remaining bit was all the hash fuzz tests.
since these are called over multiple threads, would either have to
pass around a per-thread RNG to every call, or refactor fuzz generator
into separate class, so we could make a separate instance per thread.
latter choice seemed generally cleaner anyways, so...
* Refactored fuzz generator methods into FuzzHashGeneator class.
- Uses separate RNG per thread, seeded from .getRandom() using thread name.
- removed class-scanning magic, now uses explicit lists of verifiers
& parameter generation helpers.
|
|
|
|
|
|
| |
To resolve issue #82, getrandbytes() UT reworked to use fixed set
of random set values. This removes change of errant false positives,
but makes sure it still gets checked across a few different inputs.
|
|
|
|
| |
django 1.10
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
schemes.
Expanded preset aliases to make it easier to pick desired behavior
for htpasswd_context; picks strongest available hash for various
different purposes: whether using apache 2.2 / 2.4, and whether output
should be host-specific or portable.
|
|
|
|
|
| |
* moved has_active_backend() from UTs to .registry
* moved os_crypt backend support helper from .hosts to .registry
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Still not happy with how this is structured -- would like to use simple
if/elif/else blocks within source to determine which backend to load;
but being able to switch backends on the fly is too useful in development,
and cross-fuzz-testing the various backends.
In any case, this tries to rebalance things a little -- loaders
should now be more explicit about what they're doing, at the expense
of a little more boilerplate.
passlib.utils.handlers
----------------------
* BackendMixin:
- added global thread lock to eliminate chance of changing
backends in multiple threads, and getting things scrambled.
- factored out some of set_backend()'s internals into (threadsafe)
_set_backend() helper, which invokes the loaders.
- removed _finalize_backend() entirely -- all the grunt work is now
pushed explicitly into the loaders, instead of getting something back
and then running additional code. a little more boilerplate,
but a LOT clearer.
- loaders now passed optional 'name' keyword as well,
just have to return True/False.
* SubclassBackendMixin:
- moved '_backend_owner' attr from BackendMixin to here,
renamed to '_backend_mixin_target', and made a required attr.
- _finalize_backend_mixin() methods now an implementation detail
of the particular hasher, and invoked explicitly from the loaders.
so removed base implementation of this & _finalize_backend().
- now invokes mixin_cls._load_backend_mixin()
* HasManyBackends:
- loaders now have to explicitly call ._set_calc_checksum_backend() helper,
which takes care of dryrun, etc.
HasManyBackends classes (sha256_crypt, etc)
-------------------------------------------
* loaders now invoke _set_calc_checksum_backend(), and return bool success.
SubclassMixin classes (argon2 & bcrypt)
---------------------------------------
* _finalize_backend_mixin() is now an internal detail of class,
and is called explicitly by the mixin class loaders.
* loaders renamed to _load_backend_mixin(), take in 'name' and 'dryrun'
|