From aba3d37c881f6575f866169abff7229694c16cca Mon Sep 17 00:00:00 2001 From: elcore Date: Sun, 17 Apr 2016 18:19:41 +0200 Subject: [PATCH] Error if we are unable to marshal the ECDSA private key --- caddy/https/crypto_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/caddy/https/crypto_test.go b/caddy/https/crypto_test.go index f61669d7..d1facd44 100644 --- a/caddy/https/crypto_test.go +++ b/caddy/https/crypto_test.go @@ -105,7 +105,12 @@ func PrivateKeyBytes(key crypto.PrivateKey) []byte { case *rsa.PrivateKey: keyBytes = x509.MarshalPKCS1PrivateKey(key) case *ecdsa.PrivateKey: - keyBytes, _ = x509.MarshalECPrivateKey(key) + var err error + var t *testing.T + keyBytes, err = x509.MarshalECPrivateKey(key) + if err != nil { + t.Error(err) + } } return keyBytes }