From eeacbba834e19aac580cde523f2d50ae3a0738e9 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 19 Jul 2021 08:06:04 +0200 Subject: [PATCH 1/2] Revert "test: skip tests for openssl-3.0.0-alpha15" This reverts commit 2ff93c8975508736bbc07b98cf84f47d68b47201. --- test/benchmark/test-benchmark-crypto.js | 4 ---- test/parallel/test-crypto-async-sign-verify.js | 3 --- test/parallel/test-crypto-dh-stateless.js | 3 --- test/parallel/test-crypto-key-objects.js | 3 --- test/parallel/test-crypto-keygen.js | 3 --- test/parallel/test-crypto-rsa-dsa.js | 3 --- test/parallel/test-crypto-sign-verify.js | 3 --- test/parallel/test-webcrypto-derivebits-ecdh.js | 3 --- test/parallel/test-webcrypto-derivebits-node-dh.js | 3 --- test/parallel/test-webcrypto-derivekey-ecdh.js | 3 --- test/parallel/test-webcrypto-encrypt-decrypt-rsa.js | 3 --- test/parallel/test-webcrypto-export-import-dsa.js | 3 --- test/parallel/test-webcrypto-export-import-ec.js | 3 --- test/parallel/test-webcrypto-export-import-rsa.js | 3 --- test/parallel/test-webcrypto-export-import.js | 3 --- test/parallel/test-webcrypto-rsa-pss-params.js | 3 --- test/parallel/test-webcrypto-sign-verify-ecdsa.js | 3 --- test/parallel/test-webcrypto-sign-verify-node-dsa.js | 3 --- test/parallel/test-webcrypto-sign-verify-rsa.js | 3 --- test/parallel/test-webcrypto-wrap-unwrap.js | 3 --- 20 files changed, 61 deletions(-) diff --git a/test/benchmark/test-benchmark-crypto.js b/test/benchmark/test-benchmark-crypto.js index f7f155ac8e55d8..7f6988acf234d8 100644 --- a/test/benchmark/test-benchmark-crypto.js +++ b/test/benchmark/test-benchmark-crypto.js @@ -8,10 +8,6 @@ if (!common.hasCrypto) if (common.hasFipsCrypto) common.skip('some benchmarks are FIPS-incompatible'); -if (common.hasOpenSSL3) { - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); -} - const runBenchmark = require('../common/benchmark'); runBenchmark('crypto', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js index 2e6c9e0bc539f4..4e3c32fdcd23fb 100644 --- a/test/parallel/test-crypto-async-sign-verify.js +++ b/test/parallel/test-crypto-async-sign-verify.js @@ -3,9 +3,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const util = require('util'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-dh-stateless.js b/test/parallel/test-crypto-dh-stateless.js index 658bd38fff655a..943ead06cda1fb 100644 --- a/test/parallel/test-crypto-dh-stateless.js +++ b/test/parallel/test-crypto-dh-stateless.js @@ -3,9 +3,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 3159b0da3f2901..689fbadd29d926 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -4,9 +4,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { types: { isKeyObject } } = require('util'); const { diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 4612fc4a1ac40a..58e5d305b6b05a 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -4,9 +4,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { constants, diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 567d8650c5a177..9afcb38616dafd 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -3,9 +3,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 15fa3db4a69f19..444135538ccff8 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -3,9 +3,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-webcrypto-derivebits-ecdh.js b/test/parallel/test-webcrypto-derivebits-ecdh.js index 49076ce443a54a..64cbae7cec6a03 100644 --- a/test/parallel/test-webcrypto-derivebits-ecdh.js +++ b/test/parallel/test-webcrypto-derivebits-ecdh.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle, getRandomValues } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-derivebits-node-dh.js b/test/parallel/test-webcrypto-derivebits-node-dh.js index cab7d40c1a7abf..2503bc17032e0d 100644 --- a/test/parallel/test-webcrypto-derivebits-node-dh.js +++ b/test/parallel/test-webcrypto-derivebits-node-dh.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-derivekey-ecdh.js b/test/parallel/test-webcrypto-derivekey-ecdh.js index a0bf28e89e4e3a..bdd9bd7588a763 100644 --- a/test/parallel/test-webcrypto-derivekey-ecdh.js +++ b/test/parallel/test-webcrypto-derivekey-ecdh.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle, getRandomValues } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js b/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js index e01152c07f294d..151eebd36c9765 100644 --- a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js +++ b/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-export-import-dsa.js b/test/parallel/test-webcrypto-export-import-dsa.js index 6b47b99c1ddbf8..3fddd9dd9c4559 100644 --- a/test/parallel/test-webcrypto-export-import-dsa.js +++ b/test/parallel/test-webcrypto-export-import-dsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-export-import-ec.js b/test/parallel/test-webcrypto-export-import-ec.js index e5453878a19050..31ab2c09cdb1f9 100644 --- a/test/parallel/test-webcrypto-export-import-ec.js +++ b/test/parallel/test-webcrypto-export-import-ec.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-export-import-rsa.js b/test/parallel/test-webcrypto-export-import-rsa.js index 46e96628a33f8c..f43259fd22faea 100644 --- a/test/parallel/test-webcrypto-export-import-rsa.js +++ b/test/parallel/test-webcrypto-export-import-rsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-export-import.js b/test/parallel/test-webcrypto-export-import.js index 9cf8833cecfc47..d7db433b364011 100644 --- a/test/parallel/test-webcrypto-export-import.js +++ b/test/parallel/test-webcrypto-export-import.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle, getRandomValues } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-rsa-pss-params.js b/test/parallel/test-webcrypto-rsa-pss-params.js index d52a9bf6add223..964eaf32e890fd 100644 --- a/test/parallel/test-webcrypto-rsa-pss-params.js +++ b/test/parallel/test-webcrypto-rsa-pss-params.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const { createPrivateKey, createPublicKey, diff --git a/test/parallel/test-webcrypto-sign-verify-ecdsa.js b/test/parallel/test-webcrypto-sign-verify-ecdsa.js index 8620498d89b00c..2f8f3a2fd229bd 100644 --- a/test/parallel/test-webcrypto-sign-verify-ecdsa.js +++ b/test/parallel/test-webcrypto-sign-verify-ecdsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-sign-verify-node-dsa.js b/test/parallel/test-webcrypto-sign-verify-node-dsa.js index 24d739062fb098..73b006b9236249 100644 --- a/test/parallel/test-webcrypto-sign-verify-node-dsa.js +++ b/test/parallel/test-webcrypto-sign-verify-node-dsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-sign-verify-rsa.js b/test/parallel/test-webcrypto-sign-verify-rsa.js index 2cfcf6e2ec02bd..60815c5ea0451d 100644 --- a/test/parallel/test-webcrypto-sign-verify-rsa.js +++ b/test/parallel/test-webcrypto-sign-verify-rsa.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js index 54a5a782a09586..1094845c73e143 100644 --- a/test/parallel/test-webcrypto-wrap-unwrap.js +++ b/test/parallel/test-webcrypto-wrap-unwrap.js @@ -5,9 +5,6 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -if (common.hasOpenSSL3) - common.skip('temporarily skipping for OpenSSL 3.0-alpha15'); - const assert = require('assert'); const { subtle } = require('crypto').webcrypto; From 0804afc8d87a763fc29f540f80dc89d5de8e2077 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 19 Jul 2021 08:46:00 +0200 Subject: [PATCH 2/2] test: update OpenSSL3 error messages for beta-1 This commit updates error messages that have changed while these tests were disabled. --- 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',