Skip to content

Commit 6f770af

Browse files
stefanmbrvagg
authored andcommitted
test: add hasFipsCrypto to test/common.js
Utility function for tests to check if OpenSSL is using a FIPS verified cryptographic provider. PR-URL: #3756 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Shigeki Ohtsu <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7481dee commit 6f770af

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/common.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,17 @@ Object.defineProperty(exports, 'opensslCli', {get: function() {
137137
return opensslCli;
138138
}, enumerable: true });
139139

140-
Object.defineProperty(exports, 'hasCrypto', {get: function() {
141-
return process.versions.openssl ? true : false;
142-
}});
140+
Object.defineProperty(exports, 'hasCrypto', {
141+
get: function() {
142+
return process.versions.openssl ? true : false;
143+
}
144+
});
145+
146+
Object.defineProperty(exports, 'hasFipsCrypto', {
147+
get: function() {
148+
return process.config.variables.openssl_fips ? true : false;
149+
}
150+
});
143151

144152
if (exports.isWindows) {
145153
exports.PIPE = '\\\\.\\pipe\\libuv-test';

0 commit comments

Comments
 (0)