From 7fc6e625311fb54e3e44508c9402745fd2ad5ab8 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 18 Feb 2019 13:53:12 +0800 Subject: [PATCH] src: remove `process.binding('config').fipsForced` Instead use `require('internal/options').getOptionValue` to query to value of `--force-fips`. PR-URL: https://github.com/nodejs/node/pull/26178 Reviewed-By: Daniel Bevenius Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: James M Snell --- lib/crypto.js | 6 ++---- src/node_config.cc | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/crypto.js b/lib/crypto.js index 97a9b14bc8afd6..8f26ac6c136fb5 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -37,10 +37,8 @@ const { const constants = internalBinding('constants').crypto; const { getOptionValue } = require('internal/options'); const pendingDeprecation = getOptionValue('--pending-deprecation'); -const { - fipsMode, - fipsForced -} = internalBinding('config'); +const { fipsMode } = internalBinding('config'); +const fipsForced = getOptionValue('--force-fips'); const { getFipsCrypto, setFipsCrypto } = internalBinding('crypto'); const { randomBytes, diff --git a/src/node_config.cc b/src/node_config.cc index c051e1186afa91..f1aa748bf52f52 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -38,9 +38,6 @@ static void Initialize(Local target, #ifdef NODE_FIPS_MODE READONLY_TRUE_PROPERTY(target, "fipsMode"); - // TODO(addaleax): Use options parser variable instead. - if (per_process::cli_options->force_fips_crypto) - READONLY_TRUE_PROPERTY(target, "fipsForced"); #endif #ifdef NODE_HAVE_I18N_SUPPORT