Skip to content

Commit feebdc5

Browse files
committed
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: #25563 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent dd682ce commit feebdc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-crypto-fips.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Flags: --expose-internals
12
'use strict';
23
const common = require('../common');
34
if (!common.hasCrypto)
@@ -7,6 +8,8 @@ const assert = require('assert');
78
const spawnSync = require('child_process').spawnSync;
89
const path = require('path');
910
const fixtures = require('../common/fixtures');
11+
const { internalBinding } = require('internal/test/binding');
12+
const { fipsMode } = internalBinding('config');
1013

1114
const FIPS_ENABLED = 1;
1215
const FIPS_DISABLED = 0;
@@ -24,7 +27,7 @@ const CNF_FIPS_OFF = fixtures.path('openssl_fips_disabled.cnf');
2427
let num_children_ok = 0;
2528

2629
function compiledWithFips() {
27-
return process.config.variables.openssl_fips ? true : false;
30+
return fipsMode ? true : false;
2831
}
2932

3033
function sharedOpenSSL() {

0 commit comments

Comments
 (0)