Commit aba3d37c authored by elcore's avatar elcore

Error if we are unable to marshal the ECDSA private key

parent 0890e330
...@@ -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