mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-20 03:54:09 -04:00
Enforce validity period on server_keys for fed requests. (#5321)
When handling incoming federation requests, make sure that we have an up-to-date copy of the signing key. We do not yet enforce the validity period for event signatures.
This commit is contained in:
parent
fe2294ec8d
commit
fec2dcb1a5
6 changed files with 228 additions and 88 deletions
|
@ -97,10 +97,11 @@ class GroupAttestationSigning(object):
|
|||
|
||||
# TODO: We also want to check that *new* attestations that people give
|
||||
# us to store are valid for at least a little while.
|
||||
if valid_until_ms < self.clock.time_msec():
|
||||
now = self.clock.time_msec()
|
||||
if valid_until_ms < now:
|
||||
raise SynapseError(400, "Attestation expired")
|
||||
|
||||
yield self.keyring.verify_json_for_server(server_name, attestation)
|
||||
yield self.keyring.verify_json_for_server(server_name, attestation, now)
|
||||
|
||||
def create_attestation(self, group_id, user_id):
|
||||
"""Create an attestation for the group_id and user_id with default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue