Commit 2db9d18d authored by Cole Brown's avatar Cole Brown

Use 2048 bit RSA keys in tests

parent 889386fa
...@@ -22,17 +22,6 @@ ...@@ -22,17 +22,6 @@
go get github.com/libp2p/go-libp2p-kad-dht 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 ## Usage
Go to https://godoc.org/github.com/libp2p/go-libp2p-kad-dht. Go to https://godoc.org/github.com/libp2p/go-libp2p-kad-dht.
......
...@@ -150,7 +150,7 @@ func TestPubkeyNotFound(t *testing.T) { ...@@ -150,7 +150,7 @@ func TestPubkeyNotFound(t *testing.T) {
connect(t, ctx, dhtA, dhtB) connect(t, ctx, dhtA, dhtB)
r := u.NewSeededRand(15) // generate deterministic keypair 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 { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
...@@ -181,7 +181,7 @@ func TestPubkeyBadKeyFromDHT(t *testing.T) { ...@@ -181,7 +181,7 @@ func TestPubkeyBadKeyFromDHT(t *testing.T) {
connect(t, ctx, dhtA, dhtB) connect(t, ctx, dhtA, dhtB)
_, pk, err := test.RandTestKeyPair(ci.RSA, 512) _, pk, err := test.RandTestKeyPair(ci.RSA, 2048)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment