ReviewOS

home-lang/home

node:crypto: implement SHA-224 RSA signing parity

#586
Closed chris opened this 10 days ago ·
10 days ago

Scope

Implement real node:crypto createSign/createVerify support for SHA-224 RSA signatures, including the sha224WithRSAEncryption algorithm spelling exercised by the pinned Bun corpus.

Current failure

After the native CryptoHasher/HMAC work in 37215a5, packages/runtime/test/bun-corpus/js/node/crypto/crypto.test.ts advances through all hash assertions and stops at:

  • test: crypto.createSign()/.verifySign() should create and verify digital signature for sha224WithRSAEncryption
  • error: Invalid digest
  • source: js/node/crypto/crypto.test.ts:299

Acceptance

  • Route SHA-224 signing and verification through the real crypto backend.
  • Match Bun and Node algorithm normalization and errors.
  • Make the broader crypto.test.ts advance past this assertion without fixture rewrites or canned signatures.
  • Add focused regression coverage and update #66.
10 days ago

Completed in 911b411 (fix(runtime): sign RSA payloads with EVP).

Implemented real BoringSSL EVP signing and verification callbacks for RSA PEM, PKCS#8, public-key, private-key, and certificate material; normalized RSA digest aliases including sha224WithRSAEncryption and RSA-SHA224; added PKCS#1/PSS padding and Node/Bun salt sentinel handling; routed KeyObject payloads through real PEM parsing; and removed canned fixture signature lookup and acceptance paths.

Validation:

  • js/node/crypto/crypto.test.ts: 369 / 369
  • crypto-sign-regression.test.ts: 1 / 1
  • node-crypto.test.js: 187 / 187
  • async sign/verify key-format matrix: pass
  • RSA sign/verify regression matrix advances through default padding, PSS, certificate verification, and expected error cases
  • full js/node/crypto directory: 740 pass / 4 fail; first remaining failure is unrelated DiffieHellmanGroup.verifyError behavior

Sign in to comment on this issue.