1919// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
22- /* eslint-disable node-core/crypto-check */
2322'use strict' ;
2423const process = global . process ; // Some tests tamper with the process global.
2524
@@ -57,25 +56,6 @@ const noop = () => {};
5756const hasCrypto = Boolean ( process . versions . openssl ) &&
5857 ! process . env . NODE_SKIP_CRYPTO ;
5958
60- // Synthesize OPENSSL_VERSION_NUMBER format with the layout 0xMNN00PPSL
61- const opensslVersionNumber = ( major = 0 , minor = 0 , patch = 0 ) => {
62- assert ( major >= 0 && major <= 0xf ) ;
63- assert ( minor >= 0 && minor <= 0xff ) ;
64- assert ( patch >= 0 && patch <= 0xff ) ;
65- return ( major << 28 ) | ( minor << 20 ) | ( patch << 4 ) ;
66- } ;
67-
68- let OPENSSL_VERSION_NUMBER ;
69- const hasOpenSSL = ( major = 0 , minor = 0 , patch = 0 ) => {
70- if ( ! hasCrypto ) return false ;
71- if ( OPENSSL_VERSION_NUMBER === undefined ) {
72- const regexp = / (?< m > \d + ) \. (?< n > \d + ) \. (?< p > \d + ) / ;
73- const { m, n, p } = process . versions . openssl . match ( regexp ) . groups ;
74- OPENSSL_VERSION_NUMBER = opensslVersionNumber ( m , n , p ) ;
75- }
76- return OPENSSL_VERSION_NUMBER >= opensslVersionNumber ( major , minor , patch ) ;
77- } ;
78-
7959const hasQuic = hasCrypto && ! ! process . config . variables . openssl_quic ;
8060
8161function parseTestFlags ( filename = process . argv [ 1 ] ) {
@@ -220,7 +200,6 @@ if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {
220200 } ) . enable ( ) ;
221201}
222202
223- let opensslCli = null ;
224203let inFreeBSDJail = null ;
225204let localhostIPv4 = null ;
226205
@@ -985,7 +964,6 @@ const common = {
985964 getTTYfd,
986965 hasIntl,
987966 hasCrypto,
988- hasOpenSSL,
989967 hasQuic,
990968 hasMultiLocalhost,
991969 invalidArgTypeHelper,
@@ -1027,10 +1005,6 @@ const common = {
10271005 return require ( 'os' ) . totalmem ( ) > 0x70000000 ; /* 1.75 Gb */
10281006 } ,
10291007
1030- get hasFipsCrypto ( ) {
1031- return hasCrypto && require ( 'crypto' ) . getFips ( ) ;
1032- } ,
1033-
10341008 get hasIPv6 ( ) {
10351009 const iFaces = require ( 'os' ) . networkInterfaces ( ) ;
10361010 let re ;
@@ -1047,10 +1021,6 @@ const common = {
10471021 } ) ;
10481022 } ,
10491023
1050- get hasOpenSSL3 ( ) {
1051- return hasOpenSSL ( 3 ) ;
1052- } ,
1053-
10541024 get inFreeBSDJail ( ) {
10551025 if ( inFreeBSDJail !== null ) return inFreeBSDJail ;
10561026
@@ -1100,28 +1070,6 @@ const common = {
11001070 return localhostIPv4 ;
11011071 } ,
11021072
1103- // opensslCli defined lazily to reduce overhead of spawnSync
1104- get opensslCli ( ) {
1105- if ( opensslCli !== null ) return opensslCli ;
1106-
1107- if ( process . config . variables . node_shared_openssl ) {
1108- // Use external command
1109- opensslCli = 'openssl' ;
1110- } else {
1111- // Use command built from sources included in Node.js repository
1112- opensslCli = path . join ( path . dirname ( process . execPath ) , 'openssl-cli' ) ;
1113- }
1114-
1115- if ( exports . isWindows ) opensslCli += '.exe' ;
1116-
1117- const opensslCmd = spawnSync ( opensslCli , [ 'version' ] ) ;
1118- if ( opensslCmd . status !== 0 || opensslCmd . error !== undefined ) {
1119- // OpenSSL command cannot be executed
1120- opensslCli = false ;
1121- }
1122- return opensslCli ;
1123- } ,
1124-
11251073 get PORT ( ) {
11261074 if ( + process . env . TEST_PARALLEL ) {
11271075 throw new Error ( 'common.PORT cannot be used in a parallelized test' ) ;
0 commit comments