mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-04-04 11:03:39 +00:00
Redact event if signature check fails
This commit is contained in:
parent
5357df36c9
commit
d6cb8cc242
1 changed files with 9 additions and 6 deletions
|
@ -235,13 +235,16 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
|
|||
continue
|
||||
}
|
||||
if err = gomatrixserverlib.VerifyAllEventSignatures(ctx, []*gomatrixserverlib.Event{event}, t.keys); err != nil {
|
||||
util.GetLogger(ctx).WithError(err).Warnf("Transaction: Couldn't validate signature of event %q", event.EventID())
|
||||
results[event.EventID()] = gomatrixserverlib.PDUResult{
|
||||
Error: err.Error(),
|
||||
}
|
||||
continue
|
||||
event = event.Redact()
|
||||
/*
|
||||
util.GetLogger(ctx).WithError(err).Warnf("Transaction: Couldn't validate signature of event %q", event.EventID())
|
||||
results[event.EventID()] = gomatrixserverlib.PDUResult{
|
||||
Error: err.Error(),
|
||||
}
|
||||
continue
|
||||
*/
|
||||
}
|
||||
pdus = append(pdus, event.Headered(verRes.RoomVersion))
|
||||
pdus = append(pdus, event.Redact().Headered(verRes.RoomVersion))
|
||||
}
|
||||
|
||||
// Process the events.
|
||||
|
|
Loading…
Reference in a new issue