Merge pull request #5354 from matrix-org/rav/server_keys/99-room-v5

Implement room v5 which enforces signing key validity
This commit is contained in:
Richard van der Hoff 2019-06-06 09:42:13 +01:00 committed by GitHub
commit 99d3497949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

2
changelog.d/5354.bugfix Normal file
View File

@ -0,0 +1,2 @@
Add a new room version where the timestamps on events are checked against the validity periods on signing keys.

View File

@ -82,12 +82,12 @@ class RoomVersions(object):
StateResolutionVersions.V2, StateResolutionVersions.V2,
enforce_key_validity=False, enforce_key_validity=False,
) )
VDH_TEST_KEY_VALIDITY = RoomVersion( V5 = RoomVersion(
"vdh-test-key-validity", "5",
RoomDisposition.UNSTABLE, RoomDisposition.STABLE,
EventFormatVersions.V3, EventFormatVersions.V3,
StateResolutionVersions.V2, StateResolutionVersions.V2,
enforce_key_validity=False, enforce_key_validity=True,
) )
@ -97,6 +97,6 @@ KNOWN_ROOM_VERSIONS = {
RoomVersions.V2, RoomVersions.V2,
RoomVersions.V3, RoomVersions.V3,
RoomVersions.V4, RoomVersions.V4,
RoomVersions.VDH_TEST_KEY_VALIDITY, RoomVersions.V5,
) )
} # type: dict[str, RoomVersion] } # type: dict[str, RoomVersion]