| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| |
| |
| | |
As part of merge:
* various: reverted the py26 compat fixes from rev 5e2f92012412
* test utils: stripped out "has_real_subtest" compat from rev c732a9e2a582,
since now on py35+, which always has .subTest() method
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(should fix long-standing issue 98)
* test_ext_django:
- Simplified "stock config" setup code. It now gets it's "sha_rounds" value
from the django source, so we don't have to manually update it every time
django changes their default. This should require less maintenance across
minor django releases. (Should fix issue 98, and prevent recurrence)
- Updated tests to account for quirks in how encoded hashes are handled.
Specifically: None, "", and invalid hashes all cause subtly different
behaviors across django versions. tests pass against django 1.8 - 3.1.
- split "empty hash" test out from the loop it shared with "null hash" test,
since the two behave differently.
* tox: expanded envlist to explicitly test a bunch more django versions
(1.8 - 3.1); and remove some needless "django 2.x + py2" tests
* passlib.apps: reformatted django CryptContext declarations;
added one for django 2.1 (which dropped "django_bcrypt" it's default list)
* passlib.ext.django:
- added internal "quirks" helper as central place to track
minor edge-case changes between django versions.
- passlib_to_django() helper now falls back to searching hasher classes
directly, even if patch isn't installed. this allows it to work
for django hashers that have been removed from django's default list.
|
| | | |
|
| | |
| |
| |
| | |
of Python 3.5.
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| | |
it's not actually supported by using(), and isn't needed for users
(issue 121)
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
now return a single unified InternalBackendError() class,
instead of AssertionError.
This change has a couple of parts:
* assert statements replaced with permanent checks,
since crypt() is unpredictable enough that we need to have this always on,
even if production runs code in "-O2" mode.
* added debug_only_repr() helper which allows including sensitive stuff
like salts & hash digests within error tracebacks -- will only do so
when global flag is enabled; and that's currently only set by unittest suite.
* added new InternalBackendError() exception class (a RuntimeError subclass);
which is raised instead of an AssertionError.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
when encoding issue is found, to separate this from an unexpected error
when calling crypt.crypt() (these will still raise MissingBackendError).
also tweaked internal safe_verify() helper to catch errors thrown by
os_crypt backend (MissingBackendError would previously slip through,
causing spurious UT failures)
|
| | |
| |
| |
| | |
(fixes issue 114)
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
* fix some typos
* silence unrefrenced footnote warnings (expected, can fix later)
* add intersphinx config to link to py3 stdlib
|
| |\ \
| |/ |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
forks
|
| | |
| |
| |
| | |
alternate forks
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| | |
(grafted from 2a0ee135a56568ff8442cdbc2775adc1ae8f304f)
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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().
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
also corrects some other bits in bcrypt docs.
|
| |/
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
about saslprep()
|
| |
|
|
| |
of places.
|
| | |
|
| |
|
|
| |
submodule
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* moved a bunch of pages into 'docs/narr' narrative subsection.
added placeholder pages in old locations, to minimize inbound link breakage.
* split history into separate pages, was getting way too long.
removed toplevel CHANGES file, not feasible under new structure.
* passlib.ifc split into reference & tutorial portions,
tutorial allowed subsuming a bunch of other hash-usage examples.
* added standard fragments for warning about insecure hashes,
added them to top of a LOT of hash doc pages.
* updated references, various layout tweaks
|
| |
|
|
| |
UsedTokenError now has a default message.
|
| |
|
|
|
|
|
|
|
|
|
| |
* added description of alternate caching strategy using normalize_token()
and storing tokens instead of last_counter
* added details of steps for reserializing TOTP objects w/ new secret.
* warning that TOTP keys should always be encrypted
* fixed some code block markup issues
|
| |
|
|
| |
TOTP.normalize_time() turned into class method, made public.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* updated doc strings, documented ZXCBN project urls
* wordsets now use lazy-loading dictionary, so dict can be accessed
normally, yet still preserve lazy loading behavior behind the scenes.
* unique char/word check now caches results, to speed up subsequent calls.
*
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* renamed AppWallet.can_encrypt -> AppWallet.has_secrets,
no longer set to False if AES support is missing --
that way if app provides a secret, we either encrypt or throw error,
rather than silently not encrypting.
* .to_dict()'s "encrypt" keyword now uses None as default, rather than special string "auto"
* hmac function now cached across multiple ._generate() calls,
making ._find_match() a lot faster.
* .key now a property, so that setting it clears encrypt key & hmac cache
* factored out encrypted key code into .encrypted_key property.
|