aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-04-28 11:34:19 +0100
committerGitHub <noreply@github.com>2022-04-28 11:34:19 +0100
commit2ff75b7c806829b211be0c310497728055e898cc (patch)
tree9a9995f215bd2e2e731b22839d91ed261ced99dd
parent74259f296f225510e9fbb6c5aae191c3f86c729e (diff)
Ensure signature map exists (fixes #2393) (#2397)
-rw-r--r--keyserver/internal/internal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go
index e571c7e5..1677cf8e 100644
--- a/keyserver/internal/internal.go
+++ b/keyserver/internal/internal.go
@@ -319,6 +319,9 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
// JSON, add the signatures and marshal it again, for some reason?
for targetUserID, masterKey := range res.MasterKeys {
+ if masterKey.Signatures == nil {
+ masterKey.Signatures = map[string]map[gomatrixserverlib.KeyID]gomatrixserverlib.Base64Bytes{}
+ }
for targetKeyID := range masterKey.Keys {
sigMap, err := a.DB.CrossSigningSigsForTarget(ctx, req.UserID, targetUserID, targetKeyID)
if err != nil {