Skip to content

Commit

Permalink
fixed tests
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 20, 2024
1 parent 85fd953 commit 0697044
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
Binary file not shown.
22 changes: 0 additions & 22 deletions verifier/timestamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,28 +276,6 @@ func TestAuthenticTimestamp(t *testing.T) {
}
})

t.Run("verify Authentic Timestamp failed due to failed to validate tsa cert chain", func(t *testing.T) {
signedToken, err := os.ReadFile("testdata/timestamp/countersignature/TimestampTokenWithSHA1RootCert.p7s")
if err != nil {
t.Fatalf("failed to get signedToken: %v", err)
}
envContent, err := parseEnvContent("testdata/timestamp/sigEnv/withoutTimestamp.sig", jws.MediaTypeEnvelope)
if err != nil {
t.Fatalf("failed to get signature envelope content: %v", err)
}
envContent.SignerInfo.UnsignedAttributes.TimestampSignature = signedToken
envContent.SignerInfo.Signature = []byte("notation")
outcome := &notation.VerificationOutcome{
EnvelopeContent: envContent,
VerificationLevel: trustpolicy.LevelStrict,
}
authenticTimestampResult := verifyAuthenticTimestamp(context.Background(), dummyTrustPolicy, trustStore, outcome)
expectedErrMsg := "failed to validate the timestamping certificate chain with error: root certificate with subject \"CN=DigiCert Assured ID Root CA,OU=www.digicert.com,O=DigiCert Inc,C=US\" is invalid or not self-signed. Certificate chain must end with a valid self-signed root certificate. Error: x509: cannot verify signature: insecure algorithm SHA1-RSA (temporarily override with GODEBUG=x509sha1=1)"
if err := authenticTimestampResult.Error; err == nil || err.Error() != expectedErrMsg {
t.Fatalf("expected %s, but got %s", expectedErrMsg, err)
}
})

t.Run("verify Authentic Timestamp failed due to trust store does not exist", func(t *testing.T) {
dummyTrustPolicy := &trustpolicy.TrustPolicy{
Name: "test-timestamp",
Expand Down

0 comments on commit 0697044

Please sign in to comment.