From ee93210e7e4a7c2fc722334bf436fedccaa5a703 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 7 Apr 2021 08:01:27 -0400 Subject: [PATCH] test: update parallel/test-crypto-keygen for OpenSSL 3 OpenSSL 3 returns a different error code. --- test/parallel/test-crypto-keygen.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index def42f393a2ada..cbf797c0ea2388 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -1325,6 +1325,8 @@ if (!common.hasOpenSSL3) { if (!getCurves().includes(namedCurve)) continue; + const expectedErrorCode = + common.hasOpenSSL3 ? 'ERR_OSSL_MISSING_OID' : 'ERR_OSSL_EC_MISSING_OID'; const params = { namedCurve, publicKeyEncoding: { @@ -1336,11 +1338,11 @@ if (!common.hasOpenSSL3) { assert.throws(() => { generateKeyPairSync('ec', params); }, { - code: 'ERR_OSSL_EC_MISSING_OID' + code: expectedErrorCode }); generateKeyPair('ec', params, common.mustCall((err) => { - assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID'); + assert.strictEqual(err.code, expectedErrorCode); })); } }