Skip to content

Commit bc27379

Browse files
stefanmbrvagg
authored andcommitted
test: avoid test timeouts on rpi
Generating 1024-bit primes on rpi test machines sometimes causes timeouts. Avoid this situation by using 256-bit primes when not running in FIPS mode. Fixes: #3881 PR-URL: #3902 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 272732e commit bc27379

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/parallel/test-crypto-binary-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ assert.throws(function() {
513513

514514
// Test Diffie-Hellman with two parties sharing a secret,
515515
// using various encodings as we go along
516-
var dh1 = crypto.createDiffieHellman(1024);
516+
var dh1 = crypto.createDiffieHellman(common.hasFipsCrypto ? 1024 : 256);
517517
var p1 = dh1.getPrime('buffer');
518518
var dh2 = crypto.createDiffieHellman(p1, 'base64');
519519
var key1 = dh1.generateKeys();

test/parallel/test-crypto-dh.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var crypto = require('crypto');
1111

1212
// Test Diffie-Hellman with two parties sharing a secret,
1313
// using various encodings as we go along
14-
var dh1 = crypto.createDiffieHellman(1024);
14+
var dh1 = crypto.createDiffieHellman(common.hasFipsCrypto ? 1024 : 256);
1515
var p1 = dh1.getPrime('buffer');
1616
var dh2 = crypto.createDiffieHellman(p1, 'buffer');
1717
var key1 = dh1.generateKeys();

0 commit comments

Comments
 (0)