summaryrefslogtreecommitdiff
path: root/passlib/handlers
Commit message (Collapse)AuthorAgeFilesLines
* python compat cleanup -- use magic super() callsEli Collins2020-10-0611-37/+37
|
* passlib.hash.bcrypt: remove support for "py-bcrypt" backendEli Collins2020-10-061-72/+1
|
* passlib.hash.bcrypt: remove support for "bcryptor" backendEli Collins2020-10-061-41/+2
|
* cleanup old python compat - assorted minor cleanups & fixes from conversionEli Collins2020-10-061-1/+1
|
* cleanup old python compat -- removed int_types aliasEli Collins2020-10-061-1/+1
|
* cleanup old python compat -- removed join_byte_elems() and ↵Eli Collins2020-10-061-3/+2
| | | | join_byte_values() wrappers
* cleanup old python compat -- removed iter_byte_values() wrapperEli Collins2020-10-061-3/+3
|
* cleanup old python compat -- removed byte_elem_value() wrapperEli Collins2020-10-064-9/+6
|
* cleanup old python compat -- removed str_to_usascii() wrapperEli Collins2020-10-066-15/+9
|
* cleanup old python compat -- removed uascii_to_str() wrapperEli Collins2020-10-0611-28/+25
|
* cleanup old python compat -- removed u() wrapper from some regexesEli Collins2020-10-063-20/+20
|
* cleanup old python compat -- replaced "unicode" alias in favor of "str"Eli Collins2020-10-0621-75/+67
|
* cleanup old python compat -- unified "unicode_or_bytes" aliasesEli Collins2020-10-061-2/+2
|
* cleanup old python compat -- removed "unicode_or_str" and ↵Eli Collins2020-10-063-6/+6
| | | | "native_string_types" aliases
* cleanup old python compat -- removed suppress_cause() and error_from() wrappersEli Collins2020-10-063-9/+9
|
* cleanup old python compat -- removed get_unbound_method_function() wrapperEli Collins2020-10-061-2/+1
|
* cleanup old python compat -- removed iteritems() wrapperEli Collins2020-10-062-5/+5
|
* cleanup old python compat -- removed irange() aliasEli Collins2020-10-063-8/+6
|
* cleanup old python compat -- removed PY2 & PY3 conditionalsEli Collins2020-10-062-7/+4
|
* cleanup old python compat -- removed all "from __future__" importsEli Collins2020-10-063-3/+0
|
* minor cleanups after merge -- removed some stray u() callsEli Collins2020-10-061-2/+2
|
* Merge from stableEli Collins2020-10-067-130/+463
|\
| * docs / sha crypt: commented out the "implicit_rounds" param in docs,Eli Collins2020-10-061-16/+30
| | | | | | | | | | it's not actually supported by using(), and isn't needed for users (issue 121)
| * passlib.hash: added ldap_salted_sha256 & ldap_salted_512 (issue 124)Eli Collins2020-10-051-2/+89
| |
| * passlib.handlers: cases where crypt() returns malformed hashEli Collins2020-10-055-37/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * passlib.handlers.bcrypt: safe_verify() calls should test for NotImplementedEli Collins2020-10-051-12/+12
| | | | | | | | | | before boolean; bool(NotImplemented) is deprecated as of python 3.9 (fixes issue 125)
| * utils.safe_crypt(): turns out pypy3's crypt() *does* support raw bytes.Eli Collins2020-10-031-2/+2
| | | | | | | | | | | | | | | | 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
| * bugfix: bcrypt os_crypt backend: fix some more crypt.crypt() utf8 encoding ↵Eli Collins2020-05-121-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * bcrypt: silenced "2a wraparound bug" detection warning for os_crypt backend;Eli Collins2020-05-121-5/+13
| | | | | | | | since it's expected to be present (e.g. on OpenBSD) for backward compatibility.
| * bcrypt / os_crypt backend: now throws new PasswordValueError()Eli Collins2020-05-121-15/+52
| | | | | | | | | | | | | | | | | | 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)
| * bugfix: bcrypt: test vector for "8bit bug" wasn't UTF8 safe,Eli Collins2020-05-121-9/+24
| | | | | | | | | | | | | | | | | | | | which makes os_crypt backend always fail, since crypt.crypt() can only be made to handle UTF8 byte strings. * replaced "\xA3" test vector with "\xD1\x91" (from same openwall source); since the latter is valid UTF8. * added new test vector to UT suite
| * bugfix: bcrypt os_crypt backend wasn't being detected properly under py3;Eli Collins2020-05-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * passlib.handlers.digests: make create_hex_digest() required=True by default;Eli Collins2020-05-111-4/+8
| | | | | | | | | | set explicit required=False only for digests that go away due to FIPS (followup to rev 6ac4d1b31761 on issue 116)
| * reworked lookup_hash() and create_hex_digest() internals to work betterEli Collins2020-05-021-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * passlib.hash.bcrypt_sha256: now uses hmac-sha256 instead of plain sha256Eli Collins2020-02-161-23/+133
| | | | | | | | (fixes issue 114)
| * passlib.hash.bcrypt: added notes re: final salt characterEli Collins2020-02-171-2/+6
| |
* | Merge from stableEli Collins2019-11-222-2/+14
|\ \ | |/
| * bcrypt: deprecated support for "py-bcrypt" and "bcryptor" backendsEli Collins2019-11-221-0/+11
| |
| * bugfix: argon2: replace directive with equivalent that will work under ↵Eli Collins2019-11-191-2/+3
| | | | | | | | | | | | py26/33/34 (dict comprehensions and b"" % format directives both cause issues)
| * argon2, parsehash tests -- fix some PY2 edge cases detected by CIEli Collins2019-11-111-2/+2
| |
* | argon2, parsehash tests -- fix some PY2 edge cases detected by CIEli Collins2019-11-111-2/+2
| |
* | Merge from stableEli Collins2019-11-112-3/+13
|\ \ | |/
| * bugfix: django_argon2: fix some glitches related to recent argon2 "ID" supportEli Collins2019-11-111-2/+8
| | | | | | | | | | | | | | * 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.
| * bcrypt: py2 compat fix -- add compat wrapper for edge case in pybcrypt ↵Eli Collins2019-11-111-1/+5
| | | | | | | | | | | | detection code; along with some other notes
* | Merge from stableEli Collins2019-11-101-52/+235
|\ \ | |/
| * argon2 -- check for unsupported "argon2" package, or "argon2_cffi" that's ↵Eli Collins2019-11-101-1/+15
| | | | | | | | too old.
| * argon2 -- added support for type "ID" hashes & for generating type "D" hashes.Eli Collins2019-11-101-51/+216
| | | | | | | | | | | | | | | | | | | | * 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
| * added tests for parsehash() method; fixed argon2 error (fixes issue 97)Eli Collins2019-11-101-0/+4
| | | | | | | | | | | | * UTs now has basic tests for parsehash() method * argon2: excluded some settings kwd aliases from parsehash() call
| * Back out changeset 53dc260cead7 -- restores argon2 to 16 byte hash output.Eli Collins2019-11-091-3/+4
| | | | | | | | | | | | | | | | per followup to original issue (https://bitbucket.org/ecollins/passlib/issues/88#comment-35296567) it was pointed out that citation for 32 byte hash output was out of date, and that argon2_cffi is correctly following the more up-to-date argon2 spec. this restores the stable branch to the 1.7.1 policy of following argon2_cffi's defaults.
| * Add missing comma in python string list leading to unwanted implicit string ↵Ehsan Kia2019-10-041-1/+1
| | | | | | | | concat