Skip to content

Commit

Permalink
fixes Lukasa#19 -- correct handle certificate distrust date
Browse files Browse the repository at this point in the history
It is the date after which certificates issued by this root should not be trusted, not the date the root itself becomes untrusted for all certs.
  • Loading branch information
alex committed Nov 13, 2024
1 parent 2f8a725 commit bbd91ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion certs/convert_mozilla_certdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ func OutputTrustedCerts(objects []*Object) (parsedCerts CertList) {
log.Fatalf("Unable to parse distrust after value '%s' for certificate on line %d, error %s", distrustAfter.value, cert.startingLine, err)
}

if time.Now().After(t) {
// The distrust date is for certificates issued after this date.
// The current maximum age of a WebPKI cert is 397 days, so if
// we're 398 days past the distrust date, it's impossible for
// there to be a valid cert.
if time.Now().After(t.Add(time.Hour * 24 * 398)) {
// This certificate is now distrusted.
continue
}
Expand Down

0 comments on commit bbd91ec

Please sign in to comment.