From feebdc5bc5a44779069a2269f4d3f15d4e36a277 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 18 Jan 2019 13:05:43 +0100 Subject: [PATCH] test: use fipsMode in test-crypto-fips This commit updates test/parallel/test-crypto-fips.js to use fipsMode instead of process.config.variables.openssl_fips. The motivation for this is that since the addition of the --openssl-is-fips configuration flag, it is possible to dynamically link with a FIPS compliant OpenSSL library. Using fipsMode allows for determining if there is FIPS support when statically or dynamically linking against a FIPS compatible OpenSSL library. PR-URL: https://github.com/nodejs/node/pull/25563 Reviewed-By: Michael Dawson Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-crypto-fips.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-crypto-fips.js b/test/parallel/test-crypto-fips.js index a231db2c1aa..fa4b8096897 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -1,3 +1,4 @@ +// Flags: --expose-internals 'use strict'; const common = require('../common'); if (!common.hasCrypto) @@ -7,6 +8,8 @@ const assert = require('assert'); const spawnSync = require('child_process').spawnSync; const path = require('path'); const fixtures = require('../common/fixtures'); +const { internalBinding } = require('internal/test/binding'); +const { fipsMode } = internalBinding('config'); const FIPS_ENABLED = 1; const FIPS_DISABLED = 0; @@ -24,7 +27,7 @@ const CNF_FIPS_OFF = fixtures.path('openssl_fips_disabled.cnf'); let num_children_ok = 0; function compiledWithFips() { - return process.config.variables.openssl_fips ? true : false; + return fipsMode ? true : false; } function sharedOpenSSL() {