Skip to content

Commit

Permalink
updated timestamping
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Jun 4, 2024
1 parent d13d60c commit c5ececc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ func verifyAuthenticTimestamp(ctx context.Context, trustPolicy *trustpolicy.Trus

// under signing scheme notary.x509
if signerInfo := outcome.EnvelopeContent.SignerInfo; signerInfo.SignedAttributes.SigningScheme == signature.SigningSchemeX509 {
logger.Info("under signing scheme notary.x509...")
performTimestampVerification := true
timeStampLowerLimit := time.Now()
timeStampUpperLimit := timeStampLowerLimit
Expand Down Expand Up @@ -569,6 +570,7 @@ func verifyAuthenticTimestamp(ctx context.Context, trustPolicy *trustpolicy.Trus
}
}
}
// this step is a success
return &notation.ValidationResult{
Type: trustpolicy.TypeAuthenticTimestamp,
Action: outcome.VerificationLevel.Enforcement[trustpolicy.TypeAuthenticTimestamp],
Expand Down Expand Up @@ -700,6 +702,7 @@ func verifyAuthenticTimestamp(ctx context.Context, trustPolicy *trustpolicy.Trus
}
} else if signerInfo.SignedAttributes.SigningScheme == signature.SigningSchemeX509SigningAuthority {
// under signing scheme notary.x509.signingAuthority
logger.Info("under signing scheme notary.x509.signingAuthority...")
authenticSigningTime := signerInfo.SignedAttributes.SigningTime
for _, cert := range signerInfo.CertificateChain {
if authenticSigningTime.Before(cert.NotBefore) || authenticSigningTime.After(cert.NotAfter) {
Expand Down

0 comments on commit c5ececc

Please sign in to comment.