Use 2048 bit RSA keys in tests

This commit is contained in:
Cole Brown 2019-08-02 14:18:42 -04:00
parent 889386fa7c
commit 2db9d18d58
2 changed files with 2 additions and 13 deletions

View File

@ -22,17 +22,6 @@
go get github.com/libp2p/go-libp2p-kad-dht
```
## Running Tests
This package depends on tests that require crypto keys too large to inline into
a peer ID. These tests generate 512bit RSA keys for speed purposes. To run
these tests successfully, you must set the environment variable
`LIBP2P_ALLOW_WEAK_RSA_KEYS` to any non-empty value, e.g. `1`.
```bash
$ LIBP2P_ALLOW_WEAK_RSA_KEYS=1 go test
```
## Usage
Go to https://godoc.org/github.com/libp2p/go-libp2p-kad-dht.

View File

@ -150,7 +150,7 @@ func TestPubkeyNotFound(t *testing.T) {
connect(t, ctx, dhtA, dhtB)
r := u.NewSeededRand(15) // generate deterministic keypair
_, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 512, r)
_, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 2048, r)
if err != nil {
t.Fatal(err)
}
@ -181,7 +181,7 @@ func TestPubkeyBadKeyFromDHT(t *testing.T) {
connect(t, ctx, dhtA, dhtB)
_, pk, err := test.RandTestKeyPair(ci.RSA, 512)
_, pk, err := test.RandTestKeyPair(ci.RSA, 2048)
if err != nil {
t.Fatal(err)
}