Skip to content

test: use openssl_is_fips instead of hasFipsCrypto

Currently, when dynamically linking against a FIPS enabled OpenSSL library test-process-env-allowed-flags-are-documented will fail with the following error:

assert.js:89
throw new AssertionError(obj);
^

AssertionError [ERR_ASSERTION]:
The following options are not documented as allowed in NODE_OPTIONS in
/root/node/doc/api/cli.md: --enable-fips --force-fips
at Object.<anonymous>
(/test/parallel/test-process-env-allowed-flags-are-documented.js:82:8)
  at Module._compile (internal/modules/cjs/loader.js:779:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:790:10)
  at Module.load (internal/modules/cjs/loader.js:642:32)
  at Function.Module._load (internal/modules/cjs/loader.js:555:12)
  at Function.Module.runMain (internal/modules/cjs/loader.js:842:10)
  at internal/main/run_main_module.js:17:11 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 2,
  expected: 0,
  operator: 'strictEqual'
}

This commit updates the test to use process.config.variables.openssl_is_fips instead of common.hasFipsCrypto as hasFipsCrypto only returns true if the OpenSSL library that is shipped with node was configured with FIPS enabled.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading