From 10e592f95491b3a464bbf2199e7ee5819b537570 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 13 Mar 2024 20:26:07 -0700 Subject: fix(ext/node): DH (`dhKeyAgreement`) support for `createPrivateKey` (#22891) Ref https://github.com/denoland/deno/pull/22511 --- ext/node/ops/crypto/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext') 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 -- cgit v1.2.3