Skip to content

Commit

Permalink
test: use fipsMode in test-crypto-fips
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
danbev authored and targos committed Jan 30, 2019
1 parent 1d7c963 commit 602d0e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-crypto-fips.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Flags: --expose-internals
'use strict';
const common = require('../common');
if (!common.hasCrypto)
Expand All @@ -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;
Expand All @@ -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() {
Expand Down

0 comments on commit 602d0e4

Please sign in to comment.