Skip to content

Commit 69f17f1

Browse files
Trotttargos
authored andcommitted
test: make test-dh-regr more efficient where possible
test-dh-regr is timing out in CI because crypto.createDiffieHellman() is considerably slower after an OpenSSL upgrade. This PR modifies the change from 11ad744 which made the test FIPS-compatible. When not in FIPS mode, the test will use a shorter key which will enable it to run much faster. PR-URL: #28390 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent 9f508e3 commit 69f17f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/pummel/test-dh-regr.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ if (!common.hasCrypto)
2727
const assert = require('assert');
2828
const crypto = require('crypto');
2929

30-
const p = crypto.createDiffieHellman(1024).getPrime();
30+
// FIPS requires length >= 1024 but we use 256 in this test to keep it from
31+
// taking too long and timing out in CI.
32+
const length = common.hasFipsCrypto ? 1024 : 256;
33+
34+
const p = crypto.createDiffieHellman(length).getPrime();
3135

3236
for (let i = 0; i < 2000; i++) {
3337
const a = crypto.createDiffieHellman(p);

0 commit comments

Comments
 (0)