Skip to content

Commit 540cc34

Browse files
authored
fix: remove signing time check during authenticTimestamp (#514)
Signed-off-by: Patrick Zheng <[email protected]>
1 parent 1864576 commit 540cc34

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

verifier/timestamp_test.go

-23
Original file line numberDiff line numberDiff line change
@@ -287,29 +287,6 @@ func TestAuthenticTimestamp(t *testing.T) {
287287
}
288288
})
289289

290-
t.Run("verify Authentic Timestamp failed due to signing time after timestamp value", func(t *testing.T) {
291-
signedToken, err := os.ReadFile("testdata/timestamp/countersignature/TimeStampToken.p7s")
292-
if err != nil {
293-
t.Fatalf("failed to get signedToken: %v", err)
294-
}
295-
envContent, err := parseEnvContent("testdata/timestamp/sigEnv/withoutTimestamp.sig", jws.MediaTypeEnvelope)
296-
if err != nil {
297-
t.Fatalf("failed to get signature envelope content: %v", err)
298-
}
299-
envContent.SignerInfo.UnsignedAttributes.TimestampSignature = signedToken
300-
envContent.SignerInfo.Signature = []byte("notation")
301-
envContent.SignerInfo.SignedAttributes.SigningTime = time.Date(3000, time.November, 10, 23, 0, 0, 0, time.UTC)
302-
outcome := &notation.VerificationOutcome{
303-
EnvelopeContent: envContent,
304-
VerificationLevel: trustpolicy.LevelStrict,
305-
}
306-
authenticTimestampResult := verifyAuthenticTimestamp(context.Background(), dummyTrustPolicy.Name, dummyTrustPolicy.TrustStores, dummyTrustPolicy.SignatureVerification, trustStore, revocationTimestampingValidator, outcome)
307-
expectedErrMsg := "timestamp [2021-09-17T14:09:09Z, 2021-09-17T14:09:11Z] is not bounded after the signing time \"3000-11-10 23:00:00 +0000 UTC\""
308-
if err := authenticTimestampResult.Error; err == nil || err.Error() != expectedErrMsg {
309-
t.Fatalf("expected %s, but got %s", expectedErrMsg, err)
310-
}
311-
})
312-
313290
t.Run("verify Authentic Timestamp failed due to trust store does not exist", func(t *testing.T) {
314291
dummyTrustPolicy := &trustpolicy.TrustPolicy{
315292
Name: "test-timestamp",

verifier/verifier.go

-3
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,6 @@ func verifyTimestamp(ctx context.Context, policyName string, trustStores []strin
928928
if err != nil {
929929
return fmt.Errorf("failed to verify the timestamp countersignature with error: %w", err)
930930
}
931-
if !timestamp.BoundedAfter(signerInfo.SignedAttributes.SigningTime) {
932-
return fmt.Errorf("timestamp %s is not bounded after the signing time %q", timestamp.Format(time.RFC3339), signerInfo.SignedAttributes.SigningTime)
933-
}
934931

935932
// 3. Validate timestamping certificate chain
936933
logger.Debug("Validating timestamping certificate chain...")

0 commit comments

Comments
 (0)