Fix outliers whose auth_events are in a different room are correctly rejected (#2791)

Fixes `outliers whose auth_events are in a different room are correctly
rejected`, by validating that auth events are all from the same room and
not using rejected events for event auth.
This commit is contained in:
Till 2022-10-14 09:14:54 +02:00 committed by GitHub
parent f3be4b3185
commit 088ad1dd21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 124 additions and 15 deletions

View file

@ -30,6 +30,7 @@ type eventMods struct {
unsigned interface{}
keyID gomatrixserverlib.KeyID
privKey ed25519.PrivateKey
authEvents []string
}
type eventModifier func(e *eventMods)
@ -52,6 +53,12 @@ func WithUnsigned(unsigned interface{}) eventModifier {
}
}
func WithAuthIDs(evs []string) eventModifier {
return func(e *eventMods) {
e.authEvents = evs
}
}
func WithKeyID(keyID gomatrixserverlib.KeyID) eventModifier {
return func(e *eventMods) {
e.keyID = keyID