1. 08 Oct, 2020 6 commits
    • Eli Collins's avatar
      Added tag 1.7.4 for changeset 45bd047ba3a3 · 058b04309b76
      Eli Collins authored
      --HG--
      branch : stable
      058b04309b76
    • Eli Collins's avatar
      bumped to 1.7.4, marking for release · 45bd047ba3a3
      Eli Collins authored
      --HG--
      branch : stable
      45bd047ba3a3
    • Eli Collins's avatar
      passlib.ext.django: refactored tests to give more granular results. · 8eca0f220040
      Eli Collins authored
      * refactored DjangoBehaviorTest so instead of a monolothic "test_config()" method;
        there are now a bunch of different test methods.  additionally, the ones with
        loops now use TestCase.subTest() to parameter things appropriately.
      
        *no changes to logic of the tests*
      
      * added TestCase.subTest() stub & wrapper to make debugging subtests easier.
      
      * added some documentation to test classes.
      
      --HG--
      branch : stable
      8eca0f220040
    • Eli Collins's avatar
      passlib.ext.django: Updated UTs to work with latest django release · c732a9e2a582
      Eli Collins authored
      (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.
      
      --HG--
      branch : stable
      c732a9e2a582
    • Eli Collins's avatar
      bugfix: python2.6 compat fixes -- a few "{}" set constructors slipped in. · 5e2f92012412
      Eli Collins authored
      --HG--
      branch : stable
      5e2f92012412
    • Eli Collins's avatar
      bugfix: passlib.tests: revert filtering PasslibSecurityWarning in general; · 626a25975fa3
      Eli Collins authored
      some tests depend on seeing it.
      
      (reverts change from rev be9a9121d5a7)
      
      --HG--
      branch : stable
      626a25975fa3
  2. 07 Oct, 2020 1 commit
  3. 06 Oct, 2020 11 commits
  4. 03 Oct, 2020 8 commits
  5. 12 May, 2020 9 commits
    • Eli Collins's avatar
      docs: minor adjusted to doc language · c08c120e8d9a
      Eli Collins authored
      --HG--
      branch : stable
      c08c120e8d9a
    • Eli Collins's avatar
      registry: tweak get_supported_os_crypt_schemes() warning message · c501a657dba4
      Eli Collins authored
      to include platform information.
      
      --HG--
      branch : stable
      c501a657dba4
    • Eli Collins's avatar
      bugfix: bcrypt os_crypt backend: fix some more crypt.crypt() utf8 encoding issues · 8188b99ebdf7
      Eli Collins authored
      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
      
      --HG--
      branch : stable
      8188b99ebdf7
    • Eli Collins's avatar
      bcrypt: silenced "2a wraparound bug" detection warning for os_crypt backend; · a1bba7433918
      Eli Collins authored
      since it's expected to be present (e.g. on OpenBSD) for backward compatibility.
      
      --HG--
      branch : stable
      a1bba7433918
    • Eli Collins's avatar
      tests / bcrypt: bcrypt_os_crypt_test now strips out non-UTF8 test vectors under py3, · 1a05dade4235
      Eli Collins authored
      since these can't be passed through crypt.crypt()
      
      --HG--
      branch : stable
      1a05dade4235
    • Eli Collins's avatar
      bcrypt / os_crypt backend: now throws new PasswordValueError() · bce121537061
      Eli Collins authored
      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)
      
      --HG--
      branch : stable
      bce121537061
    • Eli Collins's avatar
      bugfix: bcrypt: test vector for "8bit bug" wasn't UTF8 safe, · 5e902e321ed3
      Eli Collins authored
      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
      
      --HG--
      branch : stable
      5e902e321ed3
    • Eli Collins's avatar
      bugfix: bcrypt os_crypt backend wasn't being detected properly under py3; · 506114ff738b
      Eli Collins authored
      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.
      
      --HG--
      branch : stable
      506114ff738b
    • Eli Collins's avatar
      passlib.tests.utils: simplified OsCryptMixin's "alt hasher" test harness code. · 689bb79962ca
      Eli Collins authored
      removed two config flags (alt_safe_crypt_handler, has_os_crypt_fallback)
      in favor of making the exceptions just subclass & override the base methods.
      
      did this for bcrypt (retaining old functionality),
      and for bcrypt_sha256 (which fixes spurious errors when running tests
      on systems w/ os_crypt support, like OpenBSD).
      
      --HG--
      branch : stable
      689bb79962ca
  6. 11 May, 2020 3 commits
  7. 04 May, 2020 2 commits