Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato committed Jul 10, 2024
1 parent 126661a commit 33993ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ca/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ func TestVerifyCertChain(t *testing.T) {
// Failure: Weak key
weakSubCert, weakSubKey, _ := test.GenerateWeakSubordinateCA(rootCert, rootKey)
err = VerifyCertChain([]*x509.Certificate{weakSubCert, rootCert}, weakSubKey)
if err == nil || !strings.Contains(err.Error(), "unsupported ec curve") {
if err == nil || !strings.Contains(err.Error(), "ECDSA curve P-224 not allowed") {
t.Fatalf("expected error verifying weak cert chain: %v", err)
}

// Failure: Empty chain
err = VerifyCertChain([]*x509.Certificate{}, weakSubKey)
err = VerifyCertChain([]*x509.Certificate{}, subKey)
if err == nil || !strings.Contains(err.Error(), "certificate chain must contain at least one certificate") {
t.Fatalf("expected error verifying with empty chain: %v", err)
}
Expand Down

0 comments on commit 33993ef

Please sign in to comment.