diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index 39d6b8bd54..8db562eef1 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -707,8 +707,12 @@ fn ec_generate( use ring::signature::KeyPair; let curve = match named_curve { - "P-256" => &ring::signature::ECDSA_P256_SHA256_FIXED_SIGNING, - "P-384" => &ring::signature::ECDSA_P384_SHA384_FIXED_SIGNING, + "P-256" | "prime256v1" | "secp256r1" => { + &ring::signature::ECDSA_P256_SHA256_FIXED_SIGNING + } + "P-384" | "prime384v1" | "secp384r1" => { + &ring::signature::ECDSA_P384_SHA384_FIXED_SIGNING + } _ => return Err(type_error("Unsupported named curve")), }; diff --git a/tests/unit_node/crypto/crypto_key_test.ts b/tests/unit_node/crypto/crypto_key_test.ts index c8724d2845..6dae793369 100644 --- a/tests/unit_node/crypto/crypto_key_test.ts +++ b/tests/unit_node/crypto/crypto_key_test.ts @@ -106,7 +106,16 @@ for (const type of ["rsa", "rsa-pss", "dsa"]) { } } -for (const namedCurve of ["P-384", "P-256"]) { +for ( + const namedCurve of [ + "P-384", + "prime384v1", + "secp384r1", + "P-256", + "prime256v1", + "secp256r1", + ] +) { Deno.test({ name: `generate ec key ${namedCurve}`, fn() {