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

Remove event re-signing hacks #3367

Merged
merged 3 commits into from
Jul 18, 2018
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/3367.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unnecessary event re-signing hacks
43 changes: 0 additions & 43 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,16 +1034,6 @@ def on_event_auth(self, event_id):
[auth_id for auth_id, _ in event.auth_events],
include_given=True
)

for event in auth:
event.signatures.update(
compute_event_signature(
event,
self.hs.hostname,
self.hs.config.signing_key[0]
)
)

defer.returnValue([e for e in auth])

@log_function
Expand Down Expand Up @@ -1499,18 +1489,6 @@ def get_state_for_pdu(self, room_id, event_id):
del results[(event.type, event.state_key)]

res = list(results.values())
for event in res:
# We sign these again because there was a bug where we
# incorrectly signed things the first time round
if self.is_mine_id(event.event_id):
event.signatures.update(
compute_event_signature(
event,
self.hs.hostname,
self.hs.config.signing_key[0]
)
)

defer.returnValue(res)
else:
defer.returnValue([])
Expand Down Expand Up @@ -1582,18 +1560,6 @@ def get_persisted_pdu(self, origin, event_id):
)

if event:
if self.is_mine_id(event.event_id):
# FIXME: This is a temporary work around where we occasionally
# return events slightly differently than when they were
# originally signed
event.signatures.update(
compute_event_signature(
event,
self.hs.hostname,
self.hs.config.signing_key[0]
)
)

in_room = yield self.auth.check_host_in_room(
event.room_id,
origin
Expand Down Expand Up @@ -1858,15 +1824,6 @@ def on_query_auth(self, origin, event_id, remote_auth_chain, rejects,
local_auth_chain, remote_auth_chain
)

for event in ret["auth_chain"]:
event.signatures.update(
compute_event_signature(
event,
self.hs.hostname,
self.hs.config.signing_key[0]
)
)

logger.debug("on_query_auth returning: %s", ret)

defer.returnValue(ret)
Expand Down