From 018e8b74644506f6a5681dc27af1edfe064f815c Mon Sep 17 00:00:00 2001 From: lub Date: Sun, 3 Aug 2025 09:57:04 +0200 Subject: [PATCH] use correct seperator character maybe at least according to https://github.com/sypper-pit/php-matrix-register/blob/main/register.php#L40 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 7ca0de3..9b740ed 100644 --- a/index.php +++ b/index.php @@ -46,7 +46,7 @@ if (isset($_GET['secret']) && $_GET['secret'] === REGISTRATION_PASSWORD) { 'password' => $_POST['password'], 'admin' => 'notadmin' ]; - $content['mac'] = hash_hmac('sha1', $content['nonce']."\s".$content['username']."\s".$content['password']."\s".$content['admin'], REGISTRATION_SHARED_SECRET); + $content['mac'] = hash_hmac('sha1', $content['nonce']."\0".$content['username']."\0".$content['password']."\0".$content['admin'], REGISTRATION_SHARED_SECRET); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, SYNAPSE_URL.'/_synapse/admin/v1/register');