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

add device signatures to device key query results #6844

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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