Skip to content

Commit 5b9d28a

Browse files
committed
test,tools: drop OpenSSL 1.x-era FIPS leftovers
The openssl_fips_*.cnf fixtures use OpenSSL 1.x syntax and are unused, get_env_type() sniffed for a "-fips" version suffix that can no longer occur, and the crypto-check lint rule listed a helper that no longer exists. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent e948498 commit 5b9d28a

6 files changed

Lines changed: 10 additions & 43 deletions

File tree

test/fixtures/openssl_fips_disabled.cnf

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/fixtures/openssl_fips_enabled.cnf

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/parallel/test-dsa-fips-invalid-key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const fixtures = require('../common/fixtures');
99
const crypto = require('crypto');
1010

1111
if (!crypto.getFips()) {
12-
common.skip('node compiled without FIPS OpenSSL.');
12+
common.skip('OpenSSL is not configured for FIPS mode');
1313
}
1414

1515
const assert = require('assert');

test/parallel/test-process-versions.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,14 @@ assert.match(
104104
assert.match(process.versions.modules, /^\d+$/);
105105

106106
if (common.hasCrypto) {
107-
const { hasOpenSSL3 } = require('../common/crypto');
108107
assert.match(process.versions.ncrypto, commonTemplate);
109108
if (process.config.variables.node_shared_openssl) {
110109
assert.ok(process.versions.openssl);
111110
} else {
112-
const versionRegex = hasOpenSSL3 ?
113-
// The following also matches a development version of OpenSSL 3.x which
114-
// can be in the format '3.0.0-alpha4-dev'. This can be handy when
115-
// building and linking against the main development branch of OpenSSL.
116-
/^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/ :
117-
/^\d+\.\d+\.\d+[a-z]?(\+quic)?(-fips)?$/;
118-
assert.match(process.versions.openssl, versionRegex);
111+
// The following also matches a development version of OpenSSL 3.x which
112+
// can be in the format '3.0.0-alpha4-dev'. This can be handy when
113+
// building and linking against the main development branch of OpenSSL.
114+
assert.match(process.versions.openssl, /^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/);
119115
}
120116
}
121117

tools/eslint-rules/crypto-check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848
}
4949

5050
function isCryptoCheck(node) {
51-
return utils.usesCommonProperty(node, ['hasCrypto', 'hasFipsCrypto']);
51+
return utils.usesCommonProperty(node, ['hasCrypto']);
5252
}
5353

5454
function checkCryptoCall(node) {

tools/test.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ def BuildOptions():
14601460
help='Send SIGABRT instead of SIGTERM to kill processes that time out',
14611461
default=False, action="store_true", dest="abort_on_timeout")
14621462
result.add_argument("--type",
1463-
help="Type of build (simple, fips, coverage)",
1463+
help="Type of build (simple, coverage)",
14641464
default=None)
14651465
result.add_argument("--error-reporter",
14661466
help="use error reporter if the test uses node:test",
@@ -1622,14 +1622,9 @@ def ArgsToTestPaths(test_root, args, suites):
16221622

16231623
def get_env_type(vm, options_type, context):
16241624
if options_type is not None:
1625-
env_type = options_type
1626-
else:
1627-
# 'simple' is the default value for 'env_type'.
1628-
env_type = 'simple'
1629-
ssl_ver = Execute([vm, '-p', 'process.versions.openssl'], context).stdout
1630-
if 'fips' in ssl_ver:
1631-
env_type = 'fips'
1632-
return env_type
1625+
return options_type
1626+
# 'simple' is the default value for 'env_type'.
1627+
return 'simple'
16331628

16341629

16351630
def get_asan_state(vm, context):

0 commit comments

Comments
 (0)