Skip to content

Commit

Permalink
crypto: runtime deprecate crypto.fips
Browse files Browse the repository at this point in the history
PR-URL: #55019
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
anonrig authored Sep 25, 2024
1 parent 02cdf7b commit afe56aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2030,12 +2030,15 @@ or `module.exports` instead.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55019
description: Runtime deprecation.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/18335
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()`
and `crypto.getFips()` instead.
Expand Down
7 changes: 4 additions & 3 deletions lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ function getRandomBytesAlias(key) {
}

ObjectDefineProperties(module.exports, {
// crypto.fips is deprecated. DEP0093. Use crypto.getFips()/crypto.setFips()
fips: {
__proto__: null,
get: getFips,
set: setFips,
get: deprecate(getFips, 'The crypto.fips is deprecated. ' +
'Please use crypto.getFips()', 'DEP0093'),
set: deprecate(setFips, 'The crypto.fips is deprecated. ' +
'Please use crypto.setFips()', 'DEP0093'),
},
constants: {
__proto__: null,
Expand Down

0 comments on commit afe56aa

Please sign in to comment.