Skip to content

[codex] dispatch crypto getFips callable exports#4345

Draft
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-crypto-fips-callable-dispatch
Draft

[codex] dispatch crypto getFips callable exports#4345
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-crypto-fips-callable-dispatch

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

@andrewtdiz andrewtdiz commented Jun 4, 2026

Refs #3955.

Summary

  • route the stdlib crypto native dispatcher's getFips callable export to Node's default non-FIPS value 0
  • cover the dispatcher path used by named imports and detached callable exports with a focused unit test

Why

Direct crypto.getFips() already lowers statically to 0, but callable export dispatch did not have a getFips arm. That made import { getFips } from "node:crypto"; getFips() diverge from Node's default FIPS-disabled behavior.

Validation

  • NODE26_BIN=$(npm exec --yes --package=node@26 -- node -e 'console.log(process.execPath)'); "$NODE26_BIN" --experimental-strip-types --no-warnings test-parity/node-suite/crypto/inventory/fips-api.ts
  • cargo build -p perry -p perry-stdlib
  • cargo build -p perry-runtime
  • PERRY_ALLOW_UNIMPLEMENTED=1 PERRY_NO_AUTO_OPTIMIZE=1 PERRY_RUNTIME_DIR=$PWD/target/debug target/debug/perry compile --no-cache test-parity/node-suite/crypto/inventory/fips-api.ts -o /root/perry-worktrees/.tmp-node-crypto-fips/fips-api && /root/perry-worktrees/.tmp-node-crypto-fips/fips-api
  • cargo test -p perry-stdlib crypto_native_dispatch_get_fips_matches_default_node_mode -- --nocapture
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

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