Commit a682100c authored by elcore's avatar elcore

Merge pull request #765 from mholt/elcore-error-ecdsa

Error if we are unable to marshal the ECDSA private key
parents 0890e330 aba3d37c
...@@ -105,7 +105,12 @@ func PrivateKeyBytes(key crypto.PrivateKey) []byte { ...@@ -105,7 +105,12 @@ func PrivateKeyBytes(key crypto.PrivateKey) []byte {
case *rsa.PrivateKey: case *rsa.PrivateKey:
keyBytes = x509.MarshalPKCS1PrivateKey(key) keyBytes = x509.MarshalPKCS1PrivateKey(key)
case *ecdsa.PrivateKey: 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 return keyBytes
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment