Skip to content

test(node): enable test-crypto-keygen-async-rsa node compat test#34208

Merged
littledivy merged 1 commit into
mainfrom
orch/divybot-134
May 18, 2026
Merged

test(node): enable test-crypto-keygen-async-rsa node compat test#34208
littledivy merged 1 commit into
mainfrom
orch/divybot-134

Conversation

@divybot

@divybot divybot commented May 17, 2026

Copy link
Copy Markdown
Contributor

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 #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

  • cargo test --test node_compat test-crypto-keygen-async-rsa passes locally.

Closes denoland/orchid#134

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]>
@divybot divybot changed the title node compat: support legacy PEM (Proc-Type/DEK-Info) encrypted RSA private key decrypt test(node): enable test-crypto-keygen-async-rsa node compat test May 17, 2026
@littledivy
littledivy merged commit c4a144d into main May 18, 2026
137 of 138 checks passed
@littledivy
littledivy deleted the orch/divybot-134 branch May 18, 2026 03:05
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]>
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.

2 participants