From e5bb84da1d97f4527d3d42f4cc5a1c5cf72076d9 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 19 Sep 2024 15:53:31 -0400 Subject: [PATCH] crypto: runtime deprecate crypto.fips --- doc/api/deprecations.md | 5 ++++- lib/crypto.js | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f10265b9ddd98a..444f7c544be5bf 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,