Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
e2e: clarify the need for a federation request for e2e keys
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJJ committed Oct 26, 2020
1 parent 2e7e764 commit 198e787
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions synapse/handlers/e2e_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ async def query_devices(self, query_body, timeout, from_user_id):
user_id in cross_signing_keys["self_signing_keys"]
)

# check if only one of the cross-signing master and
# self-signing key are cached.
# for each user we want the master _and_ the self-signing key,
# so we fetch those keys from federation
# check if we are missing only one of cross-signing master or
# self-signing key, but the other one is cached.
# as we need both, this will issue a federation request.
# if we don't have any of the keys, either the user doesn't have
# cross-signing set up, or the cached device list
# is not (yet) updated.
if cached_cross_master ^ cached_cross_selfsigning:
user_ids_not_in_cache.add(user_id)

Expand Down

0 comments on commit 198e787

Please sign in to comment.