From b8d1f58f21e65df348235c533ab55ea437e3b9c5 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 14 Nov 2022 14:41:45 +0000 Subject: [PATCH] Sign the invite properly --- federationapi/routing/invite.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/federationapi/routing/invite.go b/federationapi/routing/invite.go index 522ae8711..f424fcacd 100644 --- a/federationapi/routing/invite.go +++ b/federationapi/routing/invite.go @@ -147,7 +147,8 @@ func processInvite( } } - if _, domain, err := cfg.Matrix.SplitLocalID('@', *event.StateKey()); err != nil { + _, domain, err := cfg.Matrix.SplitLocalID('@', *event.StateKey()) + if err != nil { return util.JSONResponse{ Code: http.StatusBadRequest, JSON: jsonerror.InvalidArgumentValue(fmt.Sprintf("The user ID is invalid or domain %q does not belong to this server", domain)), @@ -189,7 +190,7 @@ func processInvite( // Sign the event so that other servers will know that we have received the invite. signedEvent := event.Sign( - string(cfg.Matrix.ServerName), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey, + string(domain), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey, ) // Add the invite event to the roomserver.