diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 6d3bcf75aa688b..45fa6733cc8971 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2030,12 +2030,15 @@ or `module.exports` instead. -Type: Documentation-only +Type: Runtime The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead. diff --git a/lib/crypto.js b/lib/crypto.js index 73c2525e082e9c..943f7e49741348 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -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,