diff --git a/test/common/README.md b/test/common/README.md index 2b8f852a3b74dd..1db6d15a0d9cee 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -194,7 +194,12 @@ Indicates whether OpenSSL is available. ### hasFipsCrypto * [<boolean>] -Indicates `hasCrypto` and `crypto` with fips. +Indicates that Node.js has been linked with a FIPS compatible OpenSSL library, +and that FIPS as been enabled using `--enable-fips`. + +To only detect if the OpenSSL library is FIPS compatible, regardless if it has +been enabled or not, then `process.config.variables.openssl_is_fips` can be +used to determine that situation. ### hasIntl * [<boolean>] diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index bb203d94d370d8..79c9abe65f96d8 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -46,7 +46,14 @@ const conditionalOpts = [ return ['--openssl-config', '--tls-cipher-list', '--use-bundled-ca', '--use-openssl-ca' ].includes(opt); } }, - { include: common.hasFipsCrypto, + { + // We are using openssl_is_fips from the configuration because it could be + // the case that OpenSSL is FIPS compatible but fips has not been enabled + // (starting node with --enable-fips). If we use common.hasFipsCrypto + // that would only tells us if fips has been enabled, but in this case we + // want to check options which will be available regardless of whether fips + // is enabled at runtime or not. + include: process.config.variables.openssl_is_fips, filter: (opt) => opt.includes('-fips') }, { include: common.hasIntl, filter: (opt) => opt === '--icu-data-dir' },