summary refs log tree commit diff
path: root/debian/patches/bcrypt.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/bcrypt.patch')
-rw-r--r--debian/patches/bcrypt.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/debian/patches/bcrypt.patch b/debian/patches/bcrypt.patch
new file mode 100644
index 0000000000..a962949920
--- /dev/null
+++ b/debian/patches/bcrypt.patch
@@ -0,0 +1,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"],