Przeglądaj źródła

Fixed #27010 -- Made Argon2PasswordHasher decode with ASCII.

The underlying hasher only generates strings containing ASCII
characters so this is merely a cosmetic change.
Tim Graham 8 lat temu
rodzic
commit
967aa7f6cc
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      django/contrib/auth/hashers.py

+ 1 - 1
django/contrib/auth/hashers.py

@@ -323,7 +323,7 @@ class Argon2PasswordHasher(BasePasswordHasher):
             hash_len=argon2.DEFAULT_HASH_LENGTH,
             type=argon2.low_level.Type.I,
         )
-        return self.algorithm + data.decode('utf-8')
+        return self.algorithm + data.decode('ascii')
 
     def verify(self, password, encoded):
         argon2 = self._load_library()