Skip to content

Commit afe56aa

Browse files
authoredSep 25, 2024··
crypto: runtime deprecate crypto.fips
PR-URL: #55019 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 02cdf7b commit afe56aa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

Diff for: ‎doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2030,12 +2030,15 @@ or `module.exports` instead.
20302030

20312031
<!-- YAML
20322032
changes:
2033+
- version: REPLACEME
2034+
pr-url: https://github.com/nodejs/node/pull/55019
2035+
description: Runtime deprecation.
20332036
- version: v10.0.0
20342037
pr-url: https://github.com/nodejs/node/pull/18335
20352038
description: Documentation-only deprecation.
20362039
-->
20372040

2038-
Type: Documentation-only
2041+
Type: Runtime
20392042

20402043
The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()`
20412044
and `crypto.getFips()` instead.

Diff for: ‎lib/crypto.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,12 @@ function getRandomBytesAlias(key) {
330330
}
331331

332332
ObjectDefineProperties(module.exports, {
333-
// crypto.fips is deprecated. DEP0093. Use crypto.getFips()/crypto.setFips()
334333
fips: {
335334
__proto__: null,
336-
get: getFips,
337-
set: setFips,
335+
get: deprecate(getFips, 'The crypto.fips is deprecated. ' +
336+
'Please use crypto.getFips()', 'DEP0093'),
337+
set: deprecate(setFips, 'The crypto.fips is deprecated. ' +
338+
'Please use crypto.setFips()', 'DEP0093'),
338339
},
339340
constants: {
340341
__proto__: null,

0 commit comments

Comments
 (0)
Please sign in to comment.