Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: update parallel/test-crypto-keygen for OpenSSL 3
OpenSSL 3 returns a different error code.
  • Loading branch information
richardlau committed Apr 7, 2021
commit ee93210e7e4a7c2fc722334bf436fedccaa5a703
6 changes: 4 additions & 2 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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);
}));
}
}
Expand Down