Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: runtime deprecate crypto.fips #55019

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'),
anonrig marked this conversation as resolved.
Show resolved Hide resolved
set: deprecate(setFips, 'The crypto.fips is deprecated. ' +
'Please use crypto.setFips()', 'DEP0093'),
anonrig marked this conversation as resolved.
Show resolved Hide resolved
},
constants: {
__proto__: null,
Expand Down
Loading