Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
Add documentation considering duplicate certs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Percival committed Jan 22, 2020
1 parent 080951d commit 704e6dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions rootsanalyzer/rootsanalyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func diffRootSets(old, new []*x509.Certificate) (added, removed []*x509.Certific
oldSet[string(cert.Raw)] = cert
}
// This algorithm assumes that there are no duplicates in new.
// TODO(RJPercival): Support old and new containing duplicate certificates.
for _, cert := range new {
certDER := string(cert.Raw)
if oldSet[certDER] != nil {
Expand Down
2 changes: 2 additions & 0 deletions storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type STHWriter interface {

// RootsWriter is an interface for storing root certificates retrieved from a CT get-roots call.
type RootsWriter interface {
// WriteRoots stores the fact that the given roots were received from a particular CT Log at the specified time.
// It will remove any duplicate certificates from roots before storing them.
WriteRoots(ctx context.Context, l *ctlog.Log, roots []*x509.Certificate, receivedAt time.Time) error
}

Expand Down

0 comments on commit 704e6dc

Please sign in to comment.