summary refs log tree commit diff
path: root/debian/patches/bcrypt.patch
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-12-11 04:14:34 +1100
committerRichard van der Hoff <richard@matrix.org>2018-12-20 11:15:52 +0000
commitfd4070a85dc4ece77f2427b586c18bb1f4a04197 (patch)
tree2f10f1098e20c3a1c8d44d3bdee6da074665f7b5 /debian/patches/bcrypt.patch
parent0.34.0rc2 (diff)
downloadsynapse-fd4070a85dc4ece77f2427b586c18bb1f4a04197.tar.xz
import from package-debian-synapse
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"],