Skip to content

fix(node_crypto): validate X509 signature algorithms#36251

Open
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/x509-signature-algorithm-metadata
Open

fix(node_crypto): validate X509 signature algorithms#36251
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/x509-signature-algorithm-metadata

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

Summary

  • require the TBS and outer certificate signature algorithm identifiers to match before verification
  • validate P-256, P-384, and Ed25519 identifiers against the verifier being used
  • add positive and negative X509Certificate.verify regression fixtures

Motivation

X509Certificate.verify selected the verification operation from the supplied key type for EC and Ed25519 keys without checking that it agreed with the certificate algorithm identifiers. Node and OpenSSL treat identifier agreement as part of certificate signature verification. This aligns the behavior while retaining the currently supported algorithms.

Testing

  • cargo build --bin deno --bin test_server
  • cargo test -p unit_node_tests --test unit_node -- crypto_key_test
  • cargo clippy -p deno_node_crypto --lib -- -D warnings
  • deno lint --config tests/config/deno.json tests/unit_node/crypto/crypto_key_test.ts
  • ./tools/format.js --check ext/node_crypto/x509.rs tests/unit_node/crypto/crypto_key_test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant