From f1b6d872ddf69af972aa94ea4a2faacc682ba0e8 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 15 Mar 2022 23:51:19 +0000 Subject: [PATCH] test: fix tests affected by OpenSSL update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last OpenSSL 3 update changes behaviour back to be closer to that of OpenSSL 1.1.1. Remove some instances where we expected different errors from OpenSSL 3 versus OpenSSL 1.1.1. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/42356 Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000217.html Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen Reviewed-By: Tobias Nießen Reviewed-By: Michael Dawson --- test/parallel/test-crypto-key-objects.js | 4 +--- test/parallel/test-tls-passphrase.js | 11 ++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index e543ff730dce6b..40a982ea7b6cd6 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -546,9 +546,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', format: 'pem', passphrase: Buffer.alloc(1024, 'a') }), { - message: common.hasOpenSSL3 ? - 'error:07880109:common libcrypto routines::interrupted or cancelled' : - /bad decrypt/ + message: /bad decrypt/ }); const publicKey = createPublicKey(publicDsa); diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index ce77dd18a6e620..8d802400f6ee3b 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -223,8 +223,7 @@ server.listen(0, common.mustCall(function() { }, onSecureConnect()); })).unref(); -const errMessagePassword = common.hasOpenSSL3 ? - /Error: error:1400006B:UI routines::processing error/ : /bad decrypt/; +const errMessageDecrypt = /bad decrypt/; // Missing passphrase assert.throws(function() { @@ -234,7 +233,7 @@ assert.throws(function() { cert: cert, rejectUnauthorized: false }); -}, errMessagePassword); +}, errMessageDecrypt); assert.throws(function() { tls.connect({ @@ -243,7 +242,7 @@ assert.throws(function() { cert: cert, rejectUnauthorized: false }); -}, errMessagePassword); +}, errMessageDecrypt); assert.throws(function() { tls.connect({ @@ -252,9 +251,7 @@ assert.throws(function() { cert: cert, rejectUnauthorized: false }); -}, errMessagePassword); - -const errMessageDecrypt = /bad decrypt/; +}, errMessageDecrypt); // Invalid passphrase assert.throws(function() {