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

add device signatures to device key query results
  • Loading branch information
uhoreg authored and erikjohnston committed Feb 5, 2020
1 parent 6475382 commit 60d0672
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 60d0672

Please sign in to comment.