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

Commit

Permalink
Merge pull request #3367 from matrix-org/rav/drop_re_signing_hacks
Browse files Browse the repository at this point in the history
Remove event re-signing hacks
  • Loading branch information
richvdh authored Jul 18, 2018
2 parents c91a445 + c4e7ad0 commit dab00fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
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 @@ -906,16 +906,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 @@ -1371,18 +1361,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 @@ -1454,18 +1432,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 @@ -1730,15 +1696,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

0 comments on commit dab00fa

Please sign in to comment.