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

Send and handle cross-signing messages using the stable prefix. #10520

Merged
merged 3 commits into from
Dec 8, 2021
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/10520.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Send and handle cross-signing messages using the stable prefix.
8 changes: 6 additions & 2 deletions synapse/handlers/e2e_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ def __init__(self, hs: "HomeServer"):
else:
# Only register this edu handler on master as it requires writing
# device updates to the db
#
# FIXME: switch to m.signing_key_update when MSC1756 is merged into the spec
federation_registry.register_edu_handler(
"m.signing_key_update",
self._edu_updater.incoming_signing_key_update,
)
# also handle the unstable version
# FIXME: remove this when enough servers have upgraded
federation_registry.register_edu_handler(
"org.matrix.signing_key_update",
self._edu_updater.incoming_signing_key_update,
Expand Down
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ async def get_device_updates_by_remote(
# add the updated cross-signing keys to the results list
for user_id, result in cross_signing_keys_by_user.items():
result["user_id"] = user_id
# FIXME: switch to m.signing_key_update when MSC1756 is merged into the spec
results.append(("m.signing_key_update", result))
# also send the unstable version
# FIXME: remove this when enough servers have upgraded
results.append(("org.matrix.signing_key_update", result))

return now_stream_id, results
Expand Down
5 changes: 3 additions & 2 deletions tests/federation/test_federation_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def test_upload_signatures(self):
)

# expect signing key update edu
self.assertEqual(len(self.edus), 1)
self.assertEqual(len(self.edus), 2)
self.assertEqual(self.edus.pop(0)["edu_type"], "m.signing_key_update")
self.assertEqual(self.edus.pop(0)["edu_type"], "org.matrix.signing_key_update")

# sign the devices
Expand Down Expand Up @@ -491,7 +492,7 @@ def check_signing_key_update_txn(
) -> None:
"""Check that the txn has an EDU with a signing key update."""
edus = txn["edus"]
self.assertEqual(len(edus), 1)
self.assertEqual(len(edus), 2)

def generate_and_upload_device_signing_key(
self, user_id: str, device_id: str
Expand Down