From d58f0e005efb9bcf9c308f0fde590c7e278f7ca6 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 19 Jul 2021 08:46:00 +0200 Subject: [PATCH] test: update OpenSSL3 error messages for beta-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates error messages that have changed while these tests were disabled. PR-URL: https://github.com/nodejs/node/pull/39437 Reviewed-By: Michaƫl Zasso Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-crypto-dh-stateless.js | 2 +- test/parallel/test-crypto-key-objects.js | 7 +++---- test/parallel/test-crypto-keygen.js | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-crypto-dh-stateless.js b/test/parallel/test-crypto-dh-stateless.js index 943ead06cda1fb..b7bd83cac1621f 100644 --- a/test/parallel/test-crypto-dh-stateless.js +++ b/test/parallel/test-crypto-dh-stateless.js @@ -226,7 +226,7 @@ assert.throws(() => { crypto.generateKeyPairSync('ec', { namedCurve: not256k1 })); }, common.hasOpenSSL3 ? { name: 'Error', - code: 'ERR_OSSL_MISMATCHING_SHARED_PARAMETERS' + code: 'ERR_OSSL_MISMATCHING_DOMAIN_PARAMETERS' } : { name: 'Error', code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS' diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 689fbadd29d926..aa03a0379a291a 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -305,7 +305,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => { createPrivateKey({ key: '' }); }, common.hasOpenSSL3 ? { - message: 'Failed to read private key', + message: 'error:1E08010C:DECODER routines::unsupported', } : { message: 'error:0909006C:PEM routines:get_name:no start line', code: 'ERR_OSSL_PEM_NO_START_LINE', @@ -519,8 +519,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', // Reading an encrypted key without a passphrase should fail. assert.throws(() => createPrivateKey(privateDsa), common.hasOpenSSL3 ? { name: 'Error', - message: 'error:07880109:common libcrypto routines::interrupted or ' + - 'cancelled', + message: 'error:1E08010C:DECODER routines::unsupported', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', @@ -546,7 +545,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', passphrase: Buffer.alloc(1024, 'a') }), { message: common.hasOpenSSL3 ? - 'error:07880109:common libcrypto routines::interrupted or cancelled' : + 'error:1E08010C:DECODER routines::unsupported' : /bad decrypt/ }); diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 58e5d305b6b05a..d9fb6489786685 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -549,8 +549,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Since the private key is encrypted, signing shouldn't work anymore. assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { - message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + message: 'error:1E08010C:DECODER routines::unsupported' } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', @@ -587,8 +586,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Since the private key is encrypted, signing shouldn't work anymore. assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { - message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + message: 'error:1E08010C:DECODER routines::unsupported' } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE',