Skip to content

Commit

Permalink
updated logs
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Oct 9, 2024
1 parent bb7e390 commit f7895f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,12 @@ func verifyTimestamp(ctx context.Context, policyName string, trustStores []strin
logger.Debug("Checking the timestamp against the signing certificate chain...")
logger.Debugf("Timestamp range: %s", timestamp.Format(time.RFC3339))
for _, cert := range signerInfo.CertificateChain {
if timeOfVerification.Before(cert.NotBefore) {
logger.Debugf("certificate %q is not valid yet. It will be valid from %q", cert.Subject, cert.NotBefore.Format(time.RFC1123Z))
}
if timeOfVerification.After(cert.NotAfter) {
logger.Debugf("certificate %q expired at %q", cert.Subject, cert.NotAfter.Format(time.RFC1123Z))
}
if !timestamp.BoundedAfter(cert.NotBefore) {
return fmt.Errorf("timestamp can be before certificate %q validity period, it will be valid from %q", cert.Subject, cert.NotBefore.Format(time.RFC1123Z))
}
Expand Down

0 comments on commit f7895f7

Please sign in to comment.