From c60cd67e1c689a60f0a32ecd2bfd199552a3c75e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 16 Apr 2024 00:23:18 +0100 Subject: [PATCH] test: skip test for dynamically linked OpenSSL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a temporary measure to unblock the CI, skip the RSA implicit rejection test when Node.js is built against a dynamically linked OpenSSL. PR-URL: https://github.com/nodejs/node/pull/52542 Refs: https://github.com/nodejs/node/issues/52537 Refs: https://github.com/nodejs-private/node-private/pull/525 Refs: https://hackerone.com/reports/2269177 Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- test/parallel/test-crypto-rsa-dsa.js | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 438037acc867c2..ecda345989789d 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -223,20 +223,24 @@ function test_rsa(padding, encryptOaepHash, decryptOaepHash) { if (padding === constants.RSA_PKCS1_PADDING) { - assert.throws(() => { - crypto.privateDecrypt({ - key: rsaKeyPem, - padding: padding, - oaepHash: decryptOaepHash - }, encryptedBuffer); - }, { code: 'ERR_INVALID_ARG_VALUE' }); - assert.throws(() => { - crypto.privateDecrypt({ - key: rsaPkcs8KeyPem, - padding: padding, - oaepHash: decryptOaepHash - }, encryptedBuffer); - }, { code: 'ERR_INVALID_ARG_VALUE' }); + // TODO(richardlau): see if it's possible to determine implicit rejection + // support when dynamically linked against OpenSSL. + if (!process.config.variables.node_shared_openssl) { + assert.throws(() => { + crypto.privateDecrypt({ + key: rsaKeyPem, + padding: padding, + oaepHash: decryptOaepHash + }, encryptedBuffer); + }, { code: 'ERR_INVALID_ARG_VALUE' }); + assert.throws(() => { + crypto.privateDecrypt({ + key: rsaPkcs8KeyPem, + padding: padding, + oaepHash: decryptOaepHash + }, encryptedBuffer); + }, { code: 'ERR_INVALID_ARG_VALUE' }); + } } else { let decryptedBuffer = crypto.privateDecrypt({ key: rsaKeyPem,