Skip to content

Commit

Permalink
go-ipfs-config: Merge pull request ipfs#57 from ipfs/fix/generic-key-…
Browse files Browse the repository at this point in the history
…size

use key size constraints defined in libp2p
  • Loading branch information
Stebalien authored Dec 4, 2019
2 parents ad3cb6c + 66886eb commit 944d62b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"encoding/base64"
"errors"
"fmt"
"io"
"time"
Expand Down Expand Up @@ -152,8 +151,8 @@ func DefaultDatastoreConfig() Datastore {
func identityConfig(out io.Writer, nbits int) (Identity, error) {
// TODO guard higher up
ident := Identity{}
if nbits < 2048 {
return ident, errors.New("bitsize less than 2048 is considered unsafe")
if nbits < ci.MinRsaKeyBits {
return ident, ci.ErrRsaKeyTooSmall
}

fmt.Fprintf(out, "generating %v-bit RSA keypair...", nbits)
Expand Down

0 comments on commit 944d62b

Please sign in to comment.