From 2c2e697d6318eaa9929cf7f68432d73d2c7a5881 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 6 Mar 2016 12:43:53 +0100 Subject: kiss --- crypto.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto.go b/crypto.go index 97a9f26..ec3053f 100644 --- a/crypto.go +++ b/crypto.go @@ -73,12 +73,10 @@ func LoadCerts(r io.Reader) ([]*x509.Certificate, error) { } func NewKey(size int) (crypto.PrivateKey, error) { - switch size { - case 0: + if size == 0 { return ecdsa.GenerateKey(elliptic.P384(), rand.Reader) - default: - return rsa.GenerateKey(rand.Reader, size) } + return rsa.GenerateKey(rand.Reader, size) } func NewCSR(key crypto.PrivateKey, altnames []string) (string, error) { -- cgit v1.2.3