Title: setFips() / setEngine do not evict ciphers cache · Issue #62982 · nodejs/node · GitHub
Open Graph Title: setFips() / setEngine do not evict ciphers cache · Issue #62982 · nodejs/node
X Title: setFips() / setEngine do not evict ciphers cache · Issue #62982 · nodejs/node
Description: > require('crypto').getCiphers().length 130 > require('crypto').setFips(true) undefined > require('crypto').getCiphers().length 130 but > require('crypto').setFips(true) undefined > require('crypto').getCiphers().length 0 Also (unverifie...
Open Graph Description: > require('crypto').getCiphers().length 130 > require('crypto').setFips(true) undefined > require('crypto').getCiphers().length 130 but > require('crypto').setFips(true) undefined > require('crypto...
X Description: > require('crypto').getCiphers().length 130 > require('crypto').setFips(true) undefined > require('crypto').getCiphers().length 130 but > require('crypto'...
Opengraph URL: https://github.com/nodejs/node/issues/62982
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"setFips() / setEngine do not evict ciphers cache","articleBody":"```\n> require('crypto').getCiphers().length\n130\n> require('crypto').setFips(true)\nundefined\n> require('crypto').getCiphers().length\n130\n```\n\nbut\n\n```\n> require('crypto').setFips(true)\nundefined\n> require('crypto').getCiphers().length\n0\n```\n\n\nAlso (unverified):\n\n>`getCiphers` memoizes the cipher name list forever (`cachedResult(() => filterDuplicateStrings(_getCiphers()))`). When `setEngine(id, flags)` (also exported from this module) successfully loads an OpenSSL engine that registers additional ciphers, those new ciphers are not reflected in subsequent `getCiphers()` results because the cache is never invalidated. Similarly, on BoringSSL builds the cache is force-populated during module initialization via `conditionalAlgorithms` (the `'ChaCha20-Poly1305'` probe calls `getCiphers()`), freezing the answer before any user code runs. The sibling `_hashCache` helper in the same file explicitly clears on snapshot build / dynamic-link scenarios via `addSerializeCallback`; `getCiphers` has no such mechanism.\n>\n> `getHashes` returns a permanently-cached list from `_getHashes()` (via `cachedResult`). After a successful `setEngine(id, flags)` call (exported from this same module) loads an OpenSSL engine that registers new digest algorithms, `getHashes()` will continue to return the pre-engine snapshot. Downstream consumers — including this file's own `conditionalAlgorithms` gates for `cSHAKE*`/`SHA3-*`/ChaCha20-Poly1305 (evaluated once at module-load, so already locked in) and any external callers using `crypto.getHashes()` — will not observe engine-provided hashes. Contrast with the sibling `getHashCache` (line 81–91) which is explicitly designed to be refreshed.","author":{"url":"https://github.com/ChALkeR","@type":"Person","name":"ChALkeR"},"datePublished":"2026-04-27T01:39:40Z","url":"https://github.com/nodejs/node/issues/62982"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:faf6059d-8f81-605c-512a-3d346fb7d695 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82BE:21FC11:541D94:6E9F43:6AED28FC |
| html-safe-nonce | 1e29b61da6fabce3ec3c203adceb979d641c1b37b8a3c54bfc62bd7cf0a06aeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkJFOjIxRkMxMTo1NDFEOTQ6NkU5RjQzOjZBRUQyOEZDIiwidmlzaXRvcl9pZCI6IjkwNDA4NDcxNjQyMDMxNDk1NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 11ee12f4417b07e1180af24f4f9e9e05def8cf5d814386e0a8292cfe4117f77f |
| hovercard-subject-tag | issue:4332591962 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/62982/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0b8d665488a9bb788bc1dcd6f529489b9d6dbab13889c2dea28e782f6efb5ff7/nodejs/node/issues/62982 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b8d665488a9bb788bc1dcd6f529489b9d6dbab13889c2dea28e782f6efb5ff7/nodejs/node/issues/62982 |
| og:image:alt | > require('crypto').getCiphers().length 130 > require('crypto').setFips(true) undefined > require('crypto').getCiphers().length 130 but > require('crypto').setFips(true) undefined > require('crypto... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ChALkeR |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width