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

Commit

Permalink
Merge pull request #6844 from matrix-org/uhoreg/cross_signing_fix_dev…
Browse files Browse the repository at this point in the history
…ice_fed

* commit '74bf3fdbb':
  add changelog
  add device signatures to device key query results
  • Loading branch information
anoadragon453 committed Mar 23, 2020
2 parents d26f388 + 74bf3fd commit 432d213
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/6844.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix an issue with cross-signing where device signatures were not sent to remote servers.
10 changes: 10 additions & 0 deletions synapse/storage/data_stores/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ def _get_device_update_edus_by_remote(self, destination, from_stream_id, query_m
device_display_name = device.get("device_display_name", None)
if device_display_name:
result["device_display_name"] = device_display_name
if "signatures" in device:
for sig_user_id, sigs in device["signatures"].items():
result["keys"].setdefault("signatures", {}).setdefault(
sig_user_id, {}
).update(sigs)
else:
result["deleted"] = True

Expand Down Expand Up @@ -524,6 +529,11 @@ def _get_devices_with_keys_by_user_txn(self, txn, user_id):
device_display_name = device.get("device_display_name", None)
if device_display_name:
result["device_display_name"] = device_display_name
if "signatures" in device:
for sig_user_id, sigs in device["signatures"].items():
result["keys"].setdefault("signatures", {}).setdefault(
sig_user_id, {}
).update(sigs)

results.append(result)

Expand Down

0 comments on commit 432d213

Please sign in to comment.