synapse-product/synapse/federation
Andrew Morgan 27c1abc7b8
Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350)
This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
for attempting to pull an event from the database/(re)pull it from the
server that originally sent the event if checking the signature of the
event fails.

During backfill we *know* that we won't have the event in our database,
however it is still useful to be able to query the original sending
server as the server we're backfilling from may be acting maliciously.

The main benefit and reason for this change however is that
`_check_sigs_and_hash_and_fetch` will drop an event during backfill if
it cannot be successfully validated, whereas the current code will
simply fail the backfill request - resulting in the client's /messages
request silently being dropped.

This is a quick patch to fix backfilling rooms that contain malformed
events. A better implementation in planned in future.
2020-09-18 14:51:11 +01:00
..
sender Fix typing for notifier (#8064) 2020-08-12 14:03:08 +01:00
transport Convert federation client to async/await. (#7975) 2020-07-30 08:01:33 -04:00
__init__.py Remove unused ReplicationLayer 2018-03-13 11:00:04 +00:00
federation_base.py Replace all remaining six usage with native Python 3 equivalents (#7704) 2020-06-16 08:51:47 -04:00
federation_client.py Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350) 2020-09-18 14:51:11 +01:00
federation_server.py Put a cache on /state_ids (#7931) 2020-07-23 18:38:19 +01:00
persistence.py Clean up newline quote marks around the codebase (#6362) 2019-11-21 12:00:14 +00:00
send_queue.py Update worker docs with recent enhancements (#7969) 2020-07-29 23:22:13 +01:00
units.py Add typing to synapse.federation.sender (#6871) 2020-02-07 13:56:38 +00:00