Skip to content

Commit

Permalink
Witness bails with error if config has log configs with duplicate IDs
Browse files Browse the repository at this point in the history
This currently fails because of the colliding Rekor configs. This PR should not be merged until transparency-dev/formats#14 is addressed and the dependency here is updated.
  • Loading branch information
mhutchinson committed Jan 23, 2023
1 parent 24d1130 commit 5ee347c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions witness/golang/cmd/witness/impl/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func (config LogConfig) AsLogMap() (map[string]witness.LogInfo, error) {
if len(logID) == 0 {
logID = logfmt.ID(log.Origin, []byte(log.PublicKey))
}
if oldLog, found := logMap[logID]; found {
return nil, fmt.Errorf("colliding log configs found for key %x: %+v and %+v", logID, oldLog, logInfo)
}
logMap[logID] = logInfo
}
return logMap, nil
Expand Down

0 comments on commit 5ee347c

Please sign in to comment.