mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Merge pull request #1790 from Arvedui/argon2_fix_password_mismatch
Fix exception handling in argon2 for mismatching passwords
This commit is contained in:
@@ -12,6 +12,7 @@ from passlib.hash import bcrypt, md5_crypt, sha256_crypt, sha512_crypt
|
||||
|
||||
try:
|
||||
from argon2 import PasswordHasher as argon2_hasher
|
||||
from argon2 import exceptions as argon2_exceptions
|
||||
except ImportError:
|
||||
argon2_hasher = None
|
||||
|
||||
@@ -155,7 +156,7 @@ if argon2_hasher is not None:
|
||||
def verify(self, clearvalue, hashed_value):
|
||||
try:
|
||||
return self.hasher.verify(hashed_value, clearvalue)
|
||||
except argon2_hasher.exceptions.VerifyMismatchError:
|
||||
except argon2_exceptions.VerifyMismatchError:
|
||||
return False
|
||||
|
||||
def needs_rehash(self, hashed_value):
|
||||
|
||||
Reference in New Issue
Block a user