Skip to content
Permalink
Browse files
test: fix tests affected by OpenSSL update
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 <[email protected]>

PR-URL: #42356
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000217.html
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
mhdawson authored and richardlau committed Mar 17, 2022
1 parent 55e293e commit c8b6d92af02206913d3223ce3f4700f460f40696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
@@ -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);
@@ -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() {

0 comments on commit c8b6d92

Please sign in to comment.