mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 07:39:40 -05:00
Merge pull request #2949 from krombel/use_bcrypt_checkpw
use bcrypt.checkpw
This commit is contained in:
commit
8ffaacbee3
@ -863,8 +863,10 @@ class AuthHandler(BaseHandler):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def _do_validate_hash():
|
def _do_validate_hash():
|
||||||
return bcrypt.hashpw(password.encode('utf8') + self.hs.config.password_pepper,
|
return bcrypt.checkpw(
|
||||||
stored_hash.encode('utf8')) == stored_hash
|
password.encode('utf8') + self.hs.config.password_pepper,
|
||||||
|
stored_hash.encode('utf8')
|
||||||
|
)
|
||||||
|
|
||||||
if stored_hash:
|
if stored_hash:
|
||||||
return make_deferred_yieldable(threads.deferToThread(_do_validate_hash))
|
return make_deferred_yieldable(threads.deferToThread(_do_validate_hash))
|
||||||
|
@ -31,7 +31,7 @@ REQUIREMENTS = {
|
|||||||
"pyyaml": ["yaml"],
|
"pyyaml": ["yaml"],
|
||||||
"pyasn1": ["pyasn1"],
|
"pyasn1": ["pyasn1"],
|
||||||
"daemonize": ["daemonize"],
|
"daemonize": ["daemonize"],
|
||||||
"bcrypt": ["bcrypt"],
|
"bcrypt": ["bcrypt>=3.1.0"],
|
||||||
"pillow": ["PIL"],
|
"pillow": ["PIL"],
|
||||||
"pydenticon": ["pydenticon"],
|
"pydenticon": ["pydenticon"],
|
||||||
"ujson": ["ujson"],
|
"ujson": ["ujson"],
|
||||||
|
Loading…
Reference in New Issue
Block a user