Skip to content

Commit 7bae3d8

Browse files
danbevMylesBorins
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 <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b8b5853 commit 7bae3d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: test/parallel/test-crypto-keygen.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function convertDERToPEM(label, der) {
279279
// Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted
280280
// private key.
281281
generateKeyPair('ec', {
282-
namedCurve: 'P-192',
282+
namedCurve: 'P-256',
283283
paramEncoding: 'named',
284284
publicKeyEncoding: {
285285
type: 'spki',
@@ -643,15 +643,15 @@ function convertDERToPEM(label, der) {
643643

644644
// It should recognize both NIST and standard curve names.
645645
generateKeyPair('ec', {
646-
namedCurve: 'P-192',
646+
namedCurve: 'P-256',
647647
publicKeyEncoding: { type: 'spki', format: 'pem' },
648648
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
649649
}, common.mustCall((err, publicKey, privateKey) => {
650650
assert.ifError(err);
651651
}));
652652

653653
generateKeyPair('ec', {
654-
namedCurve: 'secp192k1',
654+
namedCurve: 'secp256k1',
655655
publicKeyEncoding: { type: 'spki', format: 'pem' },
656656
privateKeyEncoding: { type: 'pkcs8', format: 'pem' }
657657
}, common.mustCall((err, publicKey, privateKey) => {

0 commit comments

Comments
 (0)