Skip to content

Commit 2db9d18

Browse files
committed
Use 2048 bit RSA keys in tests
1 parent 889386f commit 2db9d18

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
go get github.com/libp2p/go-libp2p-kad-dht
2323
```
2424

25-
## Running Tests
26-
27-
This package depends on tests that require crypto keys too large to inline into
28-
a peer ID. These tests generate 512bit RSA keys for speed purposes. To run
29-
these tests successfully, you must set the environment variable
30-
`LIBP2P_ALLOW_WEAK_RSA_KEYS` to any non-empty value, e.g. `1`.
31-
32-
```bash
33-
$ LIBP2P_ALLOW_WEAK_RSA_KEYS=1 go test
34-
```
35-
3625
## Usage
3726

3827
Go to https://godoc.org/github.com/libp2p/go-libp2p-kad-dht.

records_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func TestPubkeyNotFound(t *testing.T) {
150150
connect(t, ctx, dhtA, dhtB)
151151

152152
r := u.NewSeededRand(15) // generate deterministic keypair
153-
_, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 512, r)
153+
_, pubk, err := ci.GenerateKeyPairWithReader(ci.RSA, 2048, r)
154154
if err != nil {
155155
t.Fatal(err)
156156
}
@@ -181,7 +181,7 @@ func TestPubkeyBadKeyFromDHT(t *testing.T) {
181181

182182
connect(t, ctx, dhtA, dhtB)
183183

184-
_, pk, err := test.RandTestKeyPair(ci.RSA, 512)
184+
_, pk, err := test.RandTestKeyPair(ci.RSA, 2048)
185185
if err != nil {
186186
t.Fatal(err)
187187
}

0 commit comments

Comments
 (0)