From 6e7992e8b89b55253e43181b4910e6cdbd01318f Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 23 Jan 2018 16:32:19 -0800 Subject: [PATCH] crypto: docs-only deprecate crypto.fips, replace Docs-only deprecate the getter/setter crypto.fips and replace with crypto.setFips() and crypto.getFips() This is specifically in preparation for ESM module support PR-URL: https://github.com/nodejs/node/pull/18335 Refs: https://github.com/nodejs/node/pull/18131 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: Guy Bedford Reviewed-By: Jon Moss Reviewed-By: Michael Dawson Reviewed-By: Ruben Bridgewater --- doc/api/crypto.md | 21 ++++++++++++ doc/api/deprecations.md | 8 +++++ lib/crypto.js | 5 +++ test/parallel/test-crypto-fips.js | 54 +++++++++++++++---------------- 4 files changed, 61 insertions(+), 27 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 5e2af21dab19a5..a06a6d1b4ef84a 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1239,11 +1239,15 @@ This property is deprecated. ### crypto.fips Property for checking and controlling whether a FIPS compliant crypto provider is currently in use. Setting to true requires a FIPS build of Node.js. +This property is deprecated. Please use `crypto.setFips()` and +`crypto.getFips()` instead. + ### crypto.createCipher(algorithm, password[, options]) + +Returns `true` if and only if a FIPS compliant crypto provider is +currently in use. + ### crypto.getHashes() +* `bool` {boolean} `true` to enable FIPS mode. + +Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. +Throws an error if FIPS mode is not available. + ### crypto.timingSafeEqual(a, b)