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 <michael_dawson@ca.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
dd682cef29
commit
feebdc5bc5
@ -1,3 +1,4 @@
|
|||||||
|
// Flags: --expose-internals
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto)
|
if (!common.hasCrypto)
|
||||||
@ -7,6 +8,8 @@ const assert = require('assert');
|
|||||||
const spawnSync = require('child_process').spawnSync;
|
const spawnSync = require('child_process').spawnSync;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fixtures = require('../common/fixtures');
|
const fixtures = require('../common/fixtures');
|
||||||
|
const { internalBinding } = require('internal/test/binding');
|
||||||
|
const { fipsMode } = internalBinding('config');
|
||||||
|
|
||||||
const FIPS_ENABLED = 1;
|
const FIPS_ENABLED = 1;
|
||||||
const FIPS_DISABLED = 0;
|
const FIPS_DISABLED = 0;
|
||||||
@ -24,7 +27,7 @@ const CNF_FIPS_OFF = fixtures.path('openssl_fips_disabled.cnf');
|
|||||||
let num_children_ok = 0;
|
let num_children_ok = 0;
|
||||||
|
|
||||||
function compiledWithFips() {
|
function compiledWithFips() {
|
||||||
return process.config.variables.openssl_fips ? true : false;
|
return fipsMode ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sharedOpenSSL() {
|
function sharedOpenSSL() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user