Skip to content

Commit 49a1a79

Browse files
committed
fixup! src: fix error handling for CryptoJob::ToResult
1 parent 537d31d commit 49a1a79

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

test/parallel/test-crypto-keygen.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,26 +1289,28 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
12891289
// This test creates EC key pairs on curves without associated OIDs.
12901290
// Specifying a key encoding should not crash.
12911291

1292-
const hasCurve = (c) => getCurves().includes(c);
1293-
const curvesWithoutOid = ['Oakley-EC2N-3', 'Oakley-EC2N-4'].filter(hasCurve);
1292+
if (process.versions.openssl >= '1.1.1i') {
1293+
const hasCurve = (c) => getCurves().includes(c);
1294+
const curvesWithoutOid = ['Oakley-EC2N-3', 'Oakley-EC2N-4'].filter(hasCurve);
12941295

1295-
for (const namedCurve of curvesWithoutOid) {
1296-
const params = {
1297-
namedCurve,
1298-
publicKeyEncoding: {
1299-
format: 'der',
1300-
type: 'spki'
1301-
}
1302-
};
1296+
for (const namedCurve of curvesWithoutOid) {
1297+
const params = {
1298+
namedCurve,
1299+
publicKeyEncoding: {
1300+
format: 'der',
1301+
type: 'spki'
1302+
}
1303+
};
13031304

1304-
assert.throws(() => {
1305-
generateKeyPairSync('ec', params);
1306-
}, {
1307-
code: 'ERR_OSSL_EC_MISSING_OID'
1308-
});
1305+
assert.throws(() => {
1306+
generateKeyPairSync('ec', params);
1307+
}, {
1308+
code: 'ERR_OSSL_EC_MISSING_OID'
1309+
});
13091310

1310-
generateKeyPair('ec', params, common.mustCall((err) => {
1311-
assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID');
1312-
}));
1311+
generateKeyPair('ec', params, common.mustCall((err) => {
1312+
assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID');
1313+
}));
1314+
}
13131315
}
13141316
}

0 commit comments

Comments
 (0)