Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 2792d04

Browse files
committed
Fix missing signature check on the /get_missing_events response
1 parent 7595fbf commit 2792d04

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roomserver/internal/input/input_missing.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,14 @@ func (t *missingStateReq) getMissingEvents(ctx context.Context, e *gomatrixserve
553553

554554
// Make sure events from the missingResp are using the cache - missing events
555555
// will be added and duplicates will be removed.
556-
logger.Debugf("get_missing_events returned %d events", len(missingResp.Events))
557556
missingEvents := make([]*gomatrixserverlib.Event, 0, len(missingResp.Events))
558557
for _, ev := range missingResp.Events.UntrustedEvents(roomVersion) {
558+
if err = ev.VerifyEventSignatures(ctx, t.keys); err != nil {
559+
continue
560+
}
559561
missingEvents = append(missingEvents, t.cacheAndReturn(ev))
560562
}
563+
logger.Debugf("get_missing_events returned %d events (%d passed signature checks)", len(missingResp.Events), len(missingEvents))
561564

562565
// topologically sort and sanity check that we are making forward progress
563566
newEvents = gomatrixserverlib.ReverseTopologicalOrdering(missingEvents, gomatrixserverlib.TopologicalOrderByPrevEvents)

0 commit comments

Comments
 (0)