mirror of
https://github.com/denoland/deno.git
synced 2025-02-14 17:47:35 -05:00
feat(ext/node): add more named curves in crypto.generateKeyPair[Sync]()
(#22882)
Towards fixing #21761
This commit is contained in:
parent
c3dbc0b38d
commit
9f8f87f27a
2 changed files with 16 additions and 3 deletions
|
@ -707,8 +707,12 @@ fn ec_generate(
|
||||||
use ring::signature::KeyPair;
|
use ring::signature::KeyPair;
|
||||||
|
|
||||||
let curve = match named_curve {
|
let curve = match named_curve {
|
||||||
"P-256" => &ring::signature::ECDSA_P256_SHA256_FIXED_SIGNING,
|
"P-256" | "prime256v1" | "secp256r1" => {
|
||||||
"P-384" => &ring::signature::ECDSA_P384_SHA384_FIXED_SIGNING,
|
&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")),
|
_ => return Err(type_error("Unsupported named curve")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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({
|
Deno.test({
|
||||||
name: `generate ec key ${namedCurve}`,
|
name: `generate ec key ${namedCurve}`,
|
||||||
fn() {
|
fn() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue