diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-08-11 02:29:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-11 14:59:53 +0530 |
commit | d6f662ac8280511fb4ef0f81777a0a6c5c08c0fa (patch) | |
tree | 4e26499934d124e83f96692af46df87746284fd7 /ext/node/ops/crypto/mod.rs | |
parent | feba133711d0ab79528134d05f1e38168305adfc (diff) |
fix(ext/node): support ieee-p1363 ECDSA signatures and pss salt len (#24981)
Fixes https://github.com/denoland/deno/issues/22919
Diffstat (limited to 'ext/node/ops/crypto/mod.rs')
-rw-r--r-- | ext/node/ops/crypto/mod.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index 05501fa87..738437577 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -362,18 +362,33 @@ pub fn op_node_sign( #[cppgc] handle: &KeyObjectHandle, #[buffer] digest: &[u8], #[string] digest_type: &str, + #[smi] pss_salt_length: Option<u32>, + #[smi] dsa_signature_encoding: u32, ) -> Result<Box<[u8]>, AnyError> { - handle.sign_prehashed(digest_type, digest) + handle.sign_prehashed( + digest_type, + digest, + pss_salt_length, + dsa_signature_encoding, + ) } -#[op2(fast)] +#[op2] pub fn op_node_verify( #[cppgc] handle: &KeyObjectHandle, #[buffer] digest: &[u8], #[string] digest_type: &str, #[buffer] signature: &[u8], + #[smi] pss_salt_length: Option<u32>, + #[smi] dsa_signature_encoding: u32, ) -> Result<bool, AnyError> { - handle.verify_prehashed(digest_type, digest, signature) + handle.verify_prehashed( + digest_type, + digest, + signature, + pss_salt_length, + dsa_signature_encoding, + ) } fn pbkdf2_sync( |