summary refs log tree commit diff
path: root/debian/patches/bcrypt.patch
blob: a96294992001cf36969bd1fc3003d1ccbea4664a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Index: package-synapse-debian/synapse/handlers/auth.py
===================================================================
--- package-synapse-debian.orig/synapse/handlers/auth.py
+++ package-synapse-debian/synapse/handlers/auth.py
@@ -921,10 +921,10 @@ class AuthHandler(BaseHandler):
             # Normalise the Unicode in the password
             pw = unicodedata.normalize("NFKC", password)
 
-            return bcrypt.checkpw(
+            return bcrypt.hashpw(
                 pw.encode('utf8') + self.hs.config.password_pepper.encode("utf8"),
                 stored_hash
-            )
+            ) == stored_hash
 
         if stored_hash:
             if not isinstance(stored_hash, bytes):
Index: package-synapse-debian/synapse/python_dependencies.py
===================================================================
--- package-synapse-debian.orig/synapse/python_dependencies.py
+++ package-synapse-debian/synapse/python_dependencies.py
@@ -49,7 +49,7 @@ REQUIREMENTS = {
     "pyasn1>=0.1.9": ["pyasn1"],
     "pyasn1-modules>=0.0.7": ["pyasn1_modules"],
     "daemonize>=2.3.1": ["daemonize"],
-    "bcrypt>=3.1.0": ["bcrypt>=3.1.0"],
+    "bcrypt": ["bcrypt"],
     "pillow>=3.1.2": ["PIL"],
     "sortedcontainers>=1.4.4": ["sortedcontainers"],
     "psutil>=2.0.0": ["psutil>=2.0.0"],