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

This commit is contained in:
Hubert Chathi 2021-12-08 05:01:38 -05:00 committed by GitHub
parent d6fb96e056
commit 8541809cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

1
changelog.d/10520.misc Normal file
View File

@ -0,0 +1 @@
Send and handle cross-signing messages using the stable prefix.

View File

@ -65,8 +65,12 @@ class E2eKeysHandler:
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,

View File

@ -274,7 +274,9 @@ class DeviceWorkerStore(SQLBaseStore):
# 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

View File

@ -266,7 +266,8 @@ class FederationSenderDevicesTestCases(HomeserverTestCase):
)
# 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
@ -491,7 +492,7 @@ class FederationSenderDevicesTestCases(HomeserverTestCase):
) -> 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