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

Patch to temporarily drop cross-user m.key_share_requests #8675

Merged
merged 8 commits into from
Oct 28, 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/8675.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Temporarily drop cross-user m.room_key_request to_device messages over performance concerns.
4 changes: 4 additions & 0 deletions synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,10 @@ async def on_edu(self, edu_type: str, origin: str, content: dict):
if not self.config.use_presence and edu_type == "m.presence":
return

# Temporary patch to drop cross-user key share requests
if edu_type == "m.room_key_request":
return

# Check if we have a handler on this instance
handler = self.edu_handlers.get(edu_type)
if handler:
Expand Down
4 changes: 4 additions & 0 deletions synapse/handlers/devicemessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ async def send_device_message(
local_messages = {}
remote_messages = {} # type: Dict[str, Dict[str, Dict[str, JsonDict]]]
for user_id, by_device in messages.items():
# Temporary patch to disable sending local cross-user key requests.
if message_type == "m.room_key_request" and user_id != sender_user_id:
continue

# we use UserID.from_string to catch invalid user ids
if self.is_mine(UserID.from_string(user_id)):
messages_by_device = {
Expand Down