diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-13 20:26:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 08:56:07 +0530 |
commit | 10e592f95491b3a464bbf2199e7ee5819b537570 (patch) | |
tree | c07b6ce2e1caa0868b731a91f68e7e3202f3f370 /ext/node/ops/crypto/mod.rs | |
parent | 66fd6f286641d4d2491d7b4bb314bd7e7eff16d8 (diff) |
fix(ext/node): DH (`dhKeyAgreement`) support for `createPrivateKey` (#22891)
Ref https://github.com/denoland/deno/pull/22511
Diffstat (limited to 'ext/node/ops/crypto/mod.rs')
-rw-r--r-- | ext/node/ops/crypto/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index c2a9b1ab7..e597a9109 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -1216,6 +1216,8 @@ pub enum AsymmetricKeyDetails { #[serde(rename = "ec")] #[serde(rename_all = "camelCase")] Ec { named_curve: String }, + #[serde(rename = "dh")] + Dh, } // https://oidref.com/ @@ -1275,6 +1277,8 @@ static MGF1_SHA1_MASK_ALGORITHM: Lazy< pub const RSA_ENCRYPTION_OID: const_oid::ObjectIdentifier = const_oid::ObjectIdentifier::new_unwrap("1.2.840.113549.1.1.1"); +pub const DH_KEY_AGREEMENT_OID: const_oid::ObjectIdentifier = + const_oid::ObjectIdentifier::new_unwrap("1.2.840.113549.1.3.1"); pub const RSASSA_PSS_OID: const_oid::ObjectIdentifier = const_oid::ObjectIdentifier::new_unwrap("1.2.840.113549.1.1.10"); pub const EC_OID: const_oid::ObjectIdentifier = @@ -1409,6 +1413,7 @@ pub fn op_node_create_private_key( .into(), }) } + DH_KEY_AGREEMENT_OID => Ok(AsymmetricKeyDetails::Dh), RSASSA_PSS_OID => { let params = PssPrivateKeyParameters::try_from( pk_info |