diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 51a4e22a0e9126..500f44357676f6 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -1289,26 +1289,28 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // This test creates EC key pairs on curves without associated OIDs. // Specifying a key encoding should not crash. - const hasCurve = (c) => getCurves().includes(c); - const curvesWithoutOid = ['Oakley-EC2N-3', 'Oakley-EC2N-4'].filter(hasCurve); + if (process.versions.openssl >= '1.1.1i') { + const hasCurve = (c) => getCurves().includes(c); + const curvesWithoutOid = ['Oakley-EC2N-3', 'Oakley-EC2N-4'].filter(hasCurve); - for (const namedCurve of curvesWithoutOid) { - const params = { - namedCurve, - publicKeyEncoding: { - format: 'der', - type: 'spki' - } - }; + for (const namedCurve of curvesWithoutOid) { + const params = { + namedCurve, + publicKeyEncoding: { + format: 'der', + type: 'spki' + } + }; - assert.throws(() => { - generateKeyPairSync('ec', params); - }, { - code: 'ERR_OSSL_EC_MISSING_OID' - }); + assert.throws(() => { + generateKeyPairSync('ec', params); + }, { + code: 'ERR_OSSL_EC_MISSING_OID' + }); - generateKeyPair('ec', params, common.mustCall((err) => { - assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID'); - })); + generateKeyPair('ec', params, common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_OSSL_EC_MISSING_OID'); + })); + } } }