summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/register_new_matrix_user2
-rw-r--r--synapse/rest/client/v1/register.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/scripts/register_new_matrix_user b/scripts/register_new_matrix_user
index 987bf32d1c..12ed20d623 100755
--- a/scripts/register_new_matrix_user
+++ b/scripts/register_new_matrix_user
@@ -32,7 +32,9 @@ def request_registration(user, password, server_location, shared_secret, admin=F
     )
 
     mac.update(user)
+    mac.update("\x00")
     mac.update(password)
+    mac.update("\x00")
     mac.update("admin" if admin else "notadmin")
 
     mac = mac.hexdigest()
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index 25d63a0b0b..83872f5f60 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -336,7 +336,9 @@ class RegisterRestServlet(ClientV1RestServlet):
             digestmod=sha1,
         )
         want_mac.update(user)
+        want_mac.update("\x00")
         want_mac.update(password)
+        want_mac.update("\x00")
         want_mac.update("admin" if admin else "notadmin")
         want_mac = want_mac.hexdigest()