From 67cb6f9a34c712a77c7d0ae57a46fa28fea2c24c Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 18 Aug 2023 01:54:34 +0200 Subject: [PATCH] test: reduce length in crypto keygen tests PR-URL: https://github.com/nodejs/node/pull/49221 Refs: https://github.com/nodejs/node/issues/49202 Refs: https://github.com/nodejs/node/issues/41206 Reviewed-By: Luigi Pinca --- .../parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js | 2 +- test/parallel/test-crypto-keygen-dh-classic.js | 2 +- test/parallel/test-crypto-keygen-empty-passphrase-no-error.js | 2 +- .../test-crypto-keygen-invalid-parameter-encoding-dsa.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js b/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js index 5f62a506334b93..449d1a97f9f68b 100644 --- a/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js +++ b/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js @@ -12,7 +12,7 @@ const { // Test async elliptic curve key generation with 'jwk' encoding and RSA. { generateKeyPair('rsa', { - modulusLength: 4096, + modulusLength: 1024, publicKeyEncoding: { format: 'jwk' }, diff --git a/test/parallel/test-crypto-keygen-dh-classic.js b/test/parallel/test-crypto-keygen-dh-classic.js index bed748ca6dd4fa..ecf5ce7863b8a4 100644 --- a/test/parallel/test-crypto-keygen-dh-classic.js +++ b/test/parallel/test-crypto-keygen-dh-classic.js @@ -12,7 +12,7 @@ const { // Test classic Diffie-Hellman key generation. { generateKeyPair('dh', { - primeLength: 1024 + primeLength: 512 }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(publicKey.type, 'public'); assert.strictEqual(publicKey.asymmetricKeyType, 'dh'); diff --git a/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js b/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js index 94cfda91bd32b9..6c7938f99e1bb6 100644 --- a/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js +++ b/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js @@ -12,7 +12,7 @@ const { // Passing an empty passphrase string should not throw ERR_OSSL_CRYPTO_MALLOC_FAILURE even on OpenSSL 3. // Regression test for https://github.com/nodejs/node/issues/41428. generateKeyPair('rsa', { - modulusLength: 4096, + modulusLength: 1024, publicKeyEncoding: { type: 'spki', format: 'pem' diff --git a/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js b/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js index fc70981ecb150b..b5ff5dc2059c1b 100644 --- a/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js +++ b/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js @@ -13,7 +13,7 @@ const { // Test invalid parameter encoding. { assert.throws(() => generateKeyPairSync('dsa', { - modulusLength: 4096, + modulusLength: 1024, publicKeyEncoding: { format: 'jwk' },