mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge pull request #765 from mholt/elcore-error-ecdsa
Error if we are unable to marshal the ECDSA private key
This commit is contained in:
commit
a682100c5e
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue