Skip to content

Commit 608181b

Browse files
committed
test: update parallel/test-crypto-keygen for OpenSSL 3
OpenSSL 3 returns a different error code.
1 parent 038608d commit 608181b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-crypto-keygen.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,8 @@ if (!common.hasOpenSSL3) {
13251325
if (!getCurves().includes(namedCurve))
13261326
continue;
13271327

1328+
const expectedErrorCode = common.hasOpenSSL3 ? 'ERR_OSSL_MISSING_OID' :
1329+
'ERR_OSSL_EC_MISSING_OID';
13281330
const params = {
13291331
namedCurve,
13301332
publicKeyEncoding: {
@@ -1336,11 +1338,11 @@ if (!common.hasOpenSSL3) {
13361338
assert.throws(() => {
13371339
generateKeyPairSync('ec', params);
13381340
}, {
1339-
code: 'ERR_OSSL_EC_MISSING_OID'
1341+
code: expectedErrorCode
13401342
});
13411343

13421344
generateKeyPair('ec', params, common.mustCall((err) => {
1343-
assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID');
1345+
assert.strictEqual(err.code, expectedErrorCode);
13441346
}));
13451347
}
13461348
}

0 commit comments

Comments
 (0)