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:
parent
f3be4b3185
commit
088ad1dd21
8 changed files with 124 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue