Skip to content

Commit efe089e

Browse files
danbevaddaleax
authored andcommitted
test: use stronger curves for keygen
This commit updates the named curves P-192 (prime192v1), and secp192k1 to 256 bit versions. The motivation for this is that in Red Hat Enterprise Linux (RHEL) all ECC curves < 224 bits are removed from OpenSSL provided by the system. I'm not sure if other distributions do this but these 256 bit curves are availalbe in OpenSSL 1.1.0j (current version on master) and OpenSSL 1.1.1 so as far as I can tell it should be safe change to make. PR-URL: #25564 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 3dcdf27 commit efe089e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-crypto-keygen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
283283
// Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted
284284
// private key.
285285
generateKeyPair('ec', {
286-
namedCurve: 'P-192',
286+
namedCurve: 'P-256',
287287
paramEncoding: 'named',
288288
publicKeyEncoding: {
289289
type: 'spki',
@@ -691,15 +691,15 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
691691

692692
// It should recognize both NIST and standard curve names.
693693
generateKeyPair('ec', {
694-
namedCurve: 'P-192',
694+
namedCurve: 'P-256',
695695
publicKeyEncoding: { type: 'spki', format: 'pem' },
696696
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
697697
}, common.mustCall((err, publicKey, privateKey) => {
698698
assert.ifError(err);
699699
}));
700700

701701
generateKeyPair('ec', {
702-
namedCurve: 'secp192k1',
702+
namedCurve: 'secp256k1',
703703
publicKeyEncoding: { type: 'spki', format: 'pem' },
704704
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
705705
}, common.mustCall((err, publicKey, privateKey) => {

0 commit comments

Comments
 (0)