From 0c21f0ae9e2a44ec6a740255981ecd795429b8b7 Mon Sep 17 00:00:00 2001 From: dharanikumar-s Date: Sun, 5 Jul 2020 22:38:45 +0530 Subject: [PATCH] Added error check after GenerateDefaultKeyPair --- authority/tls_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/authority/tls_test.go b/authority/tls_test.go index b94a6a74..e12ff266 100644 --- a/authority/tls_test.go +++ b/authority/tls_test.go @@ -372,6 +372,7 @@ ZYtQ9Ot36qc= func TestAuthority_RenewOrRekey(t *testing.T) { pub, _, err := keys.GenerateDefaultKeyPair() + assert.FatalError(t, err) pub1, _, err := keys.GenerateDefaultKeyPair() assert.FatalError(t, err) @@ -479,9 +480,9 @@ func TestAuthority_RenewOrRekey(t *testing.T) { var certChain []*x509.Certificate if tc.auth != nil { - certChain, err = tc.auth.RenewOrRekey(tc.cert,pub1) + certChain, err = tc.auth.RenewOrRekey(tc.cert, pub1) } else { - certChain, err = a.RenewOrRekey(tc.cert,pub1) + certChain, err = a.RenewOrRekey(tc.cert, pub1) } if err != nil { if assert.NotNil(t, tc.err, fmt.Sprintf("unexpected error: %s", err)) { @@ -525,7 +526,7 @@ func TestAuthority_RenewOrRekey(t *testing.T) { assert.Equals(t, leaf.ExtKeyUsage, []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}) assert.Equals(t, leaf.DNSNames, []string{"test.smallstep.com", "test"}) - assert.Equals(t, leaf.PublicKey, pub1) + assert.Equals(t, leaf.PublicKey, pub1) pubBytes, err := x509.MarshalPKIXPublicKey(pub1) assert.FatalError(t, err)