mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 04:51:22 +00:00
feat(ext/node): add more named curves in crypto.generateKeyPair[Sync]()
(#22882)
Towards fixing #21761
This commit is contained in:
parent
f50678b4f3
commit
6e6c316c9d
@ -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")),
|
||||
};
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user