Login fix for python3 (#5529)

decode bytes to string
This commit is contained in:
Ameya Shenoy 2018-05-04 18:36:27 +05:30 committed by Faris Ansari
parent 62fe836f43
commit dc8af84563

View file

@ -21,7 +21,7 @@ class LegacyPassword(pbkdf2_sha256):
# it is possible that we will generate a false positive if the users password happens to be 40 hex chars proceeded
# by an * char, but this seems highly unlikely
if not (secret[0] == "*" and len(secret) == 41 and all(c in string.hexdigits for c in secret[1:])):
secret = mysql41.hash(secret + self.salt)
secret = mysql41.hash(secret + self.salt.decode('utf-8'))
return super(LegacyPassword, self)._calc_checksum(secret)