Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 875875 Details for
Bug 918708
dev-python/bcrypt-4.1.0 breaks dev-python/passlib-1.7.4-r2
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
001_bcrypt_4v1v0_salt_type.patch
001_bcrypt_4v1v0_salt_type.patch (text/plain), 2.42 KB, created by
Daniel Pouzzner
on 2023-11-28 20:39:24 UTC
(
hide
)
Description:
001_bcrypt_4v1v0_salt_type.patch
Filename:
MIME Type:
Creator:
Daniel Pouzzner
Created:
2023-11-28 20:39:24 UTC
Size:
2.42 KB
patch
obsolete
>--- passlib-1.7.4/passlib/handlers/bcrypt.py.dist 2020-10-08 12:54:32.000000000 -0500 >+++ passlib-1.7.4/passlib/handlers/bcrypt.py 2023-11-28 14:01:58.206606162 -0600 >@@ -656,7 +656,7 @@ class _BcryptBackend(_BcryptCommon): > assert isinstance(hash, bytes) > if not hash.startswith(config) or len(hash) != len(config)+31: > raise uh.exc.CryptBackendError(self, config, hash, source="`bcrypt` package") >- return hash[-31:].decode("ascii") >+ return hash[-31:] > > #----------------------------------------------------------------------- > # bcryptor backend >@@ -759,10 +759,10 @@ class _PyBcryptBackend(_BcryptCommon): > # hash encoded as ascii bytes, returns ascii unicode. > secret, ident = self._prepare_digest_args(secret) > config = self._get_config(ident) >- hash = _pybcrypt.hashpw(secret, config) >- if not hash.startswith(config) or len(hash) != len(config) + 31: >+ hash = _pybcrypt.hashpw(secret, config.encode('ascii')) >+ if not hash.startswith(config.encode('ascii')) or len(hash) != len(config) + 31: > raise uh.exc.CryptBackendError(self, config, hash, source="pybcrypt library") >- return str_to_uascii(hash[-31:]) >+ return hash[-31:] > > _calc_checksum = _calc_checksum_raw > >@@ -862,7 +862,7 @@ class _BuiltinBackend(_BcryptCommon): > secret, ident = self._prepare_digest_args(secret) > chk = _builtin_bcrypt(secret, ident[1:-1], > self.salt.encode("ascii"), self.rounds) >- return chk.decode("ascii") >+ return chk > > #============================================================================= > # handler >--- passlib-1.7.4/passlib/utils/handlers.py.dist 2020-10-08 12:54:32.000000000 -0500 >+++ passlib-1.7.4/passlib/utils/handlers.py 2023-11-28 14:09:59.151890805 -0600 >@@ -789,7 +789,12 @@ class GenericHandler(MinimalHandler): > chk = self.checksum > if chk is None: > raise exc.MissingDigestError(cls) >- return consteq(self._calc_checksum(secret), chk) >+ calced_chk = self._calc_checksum(secret) >+ if not isinstance(calced_chk, (bytes, bytearray)): >+ calced_chk = calced_chk.encode('ascii') >+ if not isinstance(chk, (bytes, bytearray)): >+ chk = chk.encode('ascii') >+ return consteq(calced_chk, chk) > > #=================================================================== > # legacy crypt interface
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 918708
: 875875