aboutsummaryrefslogtreecommitdiff
path: root/crypto.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-06 12:43:53 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-06 12:43:53 +0100
commit2c2e697d6318eaa9929cf7f68432d73d2c7a5881 (patch)
tree7c221a4b86ddc244cd5dcb99d77778404a7e3dc7 /crypto.go
parent327e4172e4070e7ebbe4802220c82f93d6b54d95 (diff)
kiss
Diffstat (limited to 'crypto.go')
-rw-r--r--crypto.go6
1 files 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) {