19
19
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
22
- /* eslint-disable node-core/crypto-check */
23
22
'use strict' ;
24
23
const process = global . process ; // Some tests tamper with the process global.
25
24
@@ -57,25 +56,6 @@ const noop = () => {};
57
56
const hasCrypto = Boolean ( process . versions . openssl ) &&
58
57
! process . env . NODE_SKIP_CRYPTO ;
59
58
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
-
79
59
const hasQuic = hasCrypto && ! ! process . config . variables . openssl_quic ;
80
60
81
61
function parseTestFlags ( filename = process . argv [ 1 ] ) {
@@ -220,7 +200,6 @@ if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {
220
200
} ) . enable ( ) ;
221
201
}
222
202
223
- let opensslCli = null ;
224
203
let inFreeBSDJail = null ;
225
204
let localhostIPv4 = null ;
226
205
@@ -985,7 +964,6 @@ const common = {
985
964
getTTYfd,
986
965
hasIntl,
987
966
hasCrypto,
988
- hasOpenSSL,
989
967
hasQuic,
990
968
hasMultiLocalhost,
991
969
invalidArgTypeHelper,
@@ -1027,10 +1005,6 @@ const common = {
1027
1005
return require ( 'os' ) . totalmem ( ) > 0x70000000 ; /* 1.75 Gb */
1028
1006
} ,
1029
1007
1030
- get hasFipsCrypto ( ) {
1031
- return hasCrypto && require ( 'crypto' ) . getFips ( ) ;
1032
- } ,
1033
-
1034
1008
get hasIPv6 ( ) {
1035
1009
const iFaces = require ( 'os' ) . networkInterfaces ( ) ;
1036
1010
let re ;
@@ -1047,10 +1021,6 @@ const common = {
1047
1021
} ) ;
1048
1022
} ,
1049
1023
1050
- get hasOpenSSL3 ( ) {
1051
- return hasOpenSSL ( 3 ) ;
1052
- } ,
1053
-
1054
1024
get inFreeBSDJail ( ) {
1055
1025
if ( inFreeBSDJail !== null ) return inFreeBSDJail ;
1056
1026
@@ -1100,28 +1070,6 @@ const common = {
1100
1070
return localhostIPv4 ;
1101
1071
} ,
1102
1072
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
-
1125
1073
get PORT ( ) {
1126
1074
if ( + process . env . TEST_PARALLEL ) {
1127
1075
throw new Error ( 'common.PORT cannot be used in a parallelized test' ) ;
0 commit comments