Compare commits

...

2 Commits

@ -8,9 +8,7 @@ define('ACCESS_TOKEN', file_get_contents('/run/secrets/access_token'));
define('REGISTRATION_PASSWORD', file_get_contents('/run/secrets/registration_password'));
define('REGISTRATION_SHARED_SECRET', file_get_contents('/run/secrets/registration_shared_secret'));
# !qToRyKgjEuHZbzqeKv:imninja.net
define('ROOM_ID', $_ENV['ROOM_ID']);
# http://synapse:8008
define('SYNAPSE_URL', $_ENV['SYNAPSE_URL']);
if (isset($_GET['secret']) && $_GET['secret'] === REGISTRATION_PASSWORD) {
@ -48,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');

Loading…
Cancel
Save