test(node): enable test-crypto-keygen-async-rsa node compat test#34208
Merged
Conversation
The legacy PEM (Proc-Type/DEK-Info) encrypted RSA private key import path was already implemented (parse_legacy_encrypted_pem in ext/node_crypto/keys.rs), but this test stayed disabled. Verified locally that PKCS#1 PEM with AES-256-CBC + passphrase 'secret' round trips through generateKeyPair → privateDecrypt/Sign with passphrase → sign-without-passphrase throws ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED. Closes denoland/orchid#134 Co-Authored-By: Divy Srivastava <[email protected]>
littledivy
added a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…34208) ## Summary Enables `parallel/test-crypto-keygen-async-rsa.js` in the node_compat suite. The legacy PEM (Proc-Type/DEK-Info) encrypted RSA private key import/export paths required by this test were already implemented in `parse_legacy_encrypted_pem` and `encrypt_private_key_pem` (`ext/node_crypto/keys.rs`); the test was left ignored after the EC counterpart was enabled in denoland#33769. Verified locally against a 512-bit RSA key generated via `generateKeyPair('rsa', { ..., privateKeyEncoding: { type: 'pkcs1', format: 'pem', cipher: 'aes-256-cbc', passphrase: 'secret' }})`: - Generated PEM matches `pkcs1EncExp('AES-256-CBC')` (Proc-Type / DEK-Info headers, 64-char base64 body). - Sign without passphrase throws `ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED` — matches the OpenSSL 3 expectation in the test. - `publicEncrypt`/`privateDecrypt` and sign/verify round-trip correctly when the passphrase is supplied. ## Test plan - [x] `cargo test --test node_compat test-crypto-keygen-async-rsa` passes locally. Closes denoland/orchid#134 Co-authored-by: divybot <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables
parallel/test-crypto-keygen-async-rsa.jsin the node_compat suite. The legacy PEM (Proc-Type/DEK-Info) encrypted RSA private key import/export paths required by this test were already implemented inparse_legacy_encrypted_pemandencrypt_private_key_pem(ext/node_crypto/keys.rs); the test was left ignored after the EC counterpart was enabled in #33769.Verified locally against a 512-bit RSA key generated via
generateKeyPair('rsa', { ..., privateKeyEncoding: { type: 'pkcs1', format: 'pem', cipher: 'aes-256-cbc', passphrase: 'secret' }}):pkcs1EncExp('AES-256-CBC')(Proc-Type / DEK-Info headers, 64-char base64 body).ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED— matches the OpenSSL 3 expectation in the test.publicEncrypt/privateDecryptand sign/verify round-trip correctly when the passphrase is supplied.Test plan
cargo test --test node_compat test-crypto-keygen-async-rsapasses locally.Closes denoland/orchid#134