From c215378411ab7604e8687b60e2dca7c2391271ba Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 16 Apr 2020 17:23:28 +0100 Subject: [PATCH] Make changelog more useful --- changelog.d/7289.bugfix | 2 +- synapse/handlers/e2e_keys.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.d/7289.bugfix b/changelog.d/7289.bugfix index e3c96dba95..5b4fbd77ac 100644 --- a/changelog.d/7289.bugfix +++ b/changelog.d/7289.bugfix @@ -1 +1 @@ -Query remote user's cross-signing keys on local user cross-signing signature upload if necessary. \ No newline at end of file +Fix an edge-case where it was not possible to cross-sign a user which did not share a room with any user on your homeserver. The bug only affected Synapse deployments in worker mode. diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py index f92544c731..fee1f9d509 100644 --- a/synapse/handlers/e2e_keys.py +++ b/synapse/handlers/e2e_keys.py @@ -973,6 +973,8 @@ class E2eKeysHandler(object): self, user_id, desired_key_type, from_user_id=None ): """Fetch the cross-signing public key from storage and interpret it. + If we cannot find the public key locally, we query the keys from the + homeserver they belong to, then update our local copy. Args: user_id (str): the user whose key should be fetched @@ -994,11 +996,10 @@ class E2eKeysHandler(object): # If we still can't find the key, and we're looking for keys of another user, # then attempt to fetch the missing key from the remote user's server. - # - # We don't get "user_signing" keys from remote servers, so disallow that here if ( key is None and not self.is_mine(user) + # We don't get "user_signing" keys from remote servers, so disallow that here and desired_key_type != "user_signing" ): try: