| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
join_byte_values() wrappers
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
"native_string_types" aliases
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
removing unittest2 also allowed removing "passlib.tests.backports"
|
| |
|
|
|
|
| |
of Python 3.5.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
isn't available.
(needed for windows)
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
before boolean; bool(NotImplemented) is deprecated as of python 3.9
(fixes issue 125)
|
| |
| |
| |
| |
| |
| |
| |
| | |
so instead of assuming safe_crypt() can only take UTF8 under py3,
and anything under py2; code is now tied to "crypt_accepts_bytes"
flag which does quick capability-detection when module loads.
this updates the changes from rev 67c619208229
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
issues
which were causing it to fail to generate a hash.
bcrypt
------
* _norm_digest(): fixed some PasslibValueError()s being thrown by os_crypt
backend during UT fuzz verifier. These were due to non-UTF8 input
being provided to crypt.crypt()... even though secret itself was UTF8 safe!
This was because secret was being truncated/repeated as part of
various backend bug workarounds; and the truncate/repeat operations
weren't being done in manner that respected UTF8 character boundaries.
This has now been fixed via _require_valid_utf8_bytes flag
(which has been set for os_crypt backend), that enables
utf8-safe mode of operation.
utils
-----
* added utf8_truncate() and utf8_repeat_string() helpers, for bcrypt fixes above.
* simplified repeat_string() internals
|
| |
| |
| |
| |
| |
| | |
under py3,
since these can't be passed through crypt.crypt()
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
due to a few interlocking issues.
passlib.utils: test_crypt() shouldn't accept hash=<bytes>,
because equality comparison with str will always fail under py3.
* test_crypt() now enforces hash=<unicode_or_str> as input.
it previously allowed hash=bytes, but equality comparison
with unicode (output by safe_crypt) would always return False
under python 3.
* bcrypt's TEST_HASH_2A constant was stored bytes, which was causing os_crypt
detection to fail due to test_crypt() bug above. changed to use native str.
sidewnote: this would have been caught by UTs, except for bug in
test_82_crypt_support() that was fixed in rev 43bae3f786b7.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
on FIPS systems (issue 116).
* lookup_hash():
- moved all hash consturctor error checks / handling into HashInfo object,
which simplifies lookup_hash() internals
- [minor] added "required" kwd, inverse of the now-deprecated "return_unknown" kwd
- [minor] now caches unknown/unsupported HashInfo records.
* HashInfo:
- now catches ValueErrors thrown by hash constructor,
and special-cased detection of "disabled for fips" errors.
- stub instances now have constructor that throws UnknownHashError,
instead of being None. calling code should detect stub instances via
the new "not info.supported" instead of testing for "info.const is None".
* create_hex_digest() now defaults to creating handlers w/ mock hash func
when it's not present (e.g. due to FIPS). this should let them be imported;
and defer the errors until they're actually used.
* added _set_mock_fips_mode() and some helps to make lookup_hash()
fake a FIPS mode system (per traceback provided in issue comments).
used this to make some preliminary UTs for the digest & hasher changes above.
|
| |
| |
| |
| | |
(fixes issue 115)
|
| |
| |
| |
| | |
(fixes issue 113)
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
py26/33/34
(dict comprehensions and b"" % format directives both cause issues)
|
| |
| |
| |
| |
| |
| | |
mask_value() function;
adjusted UTs
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
This was a deprecation when running in Python 3.7:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
if isinstance(source, collections.Sequence):
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function time.clock(), used in passlib/utils/__init__.py
has been removed. It was deprecated since Python 3.3.
More info:
https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals
To make the code both Python 2 and 3 compatible, use timeit.default_timer
|