Skip to content

Commit

Permalink
test: skip test for dynamically linked OpenSSL
Browse files Browse the repository at this point in the history
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: #52542
Refs: #52537
Refs: nodejs-private/node-private#525
Refs: https://hackerone.com/reports/2269177
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
richardlau authored and marco-ippolito committed Apr 23, 2024
1 parent 204018b commit afaf889
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions test/parallel/test-crypto-rsa-dsa.js
Expand Up @@ -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,
Expand Down

0 comments on commit afaf889

Please sign in to comment.