MCPcopy Index your code
hub / github.com/nodejs/node / configure_openssl

Function configure_openssl

configure.py:2235–2305  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

2233 o['variables']['v8_enable_wasm_simd256_revec'] = 1
2234
2235def configure_openssl(o):
2236 variables = o['variables']
2237 variables['node_use_openssl'] = b(not options.without_ssl)
2238 variables['node_shared_openssl'] = b(options.shared_openssl)
2239 variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
2240 variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
2241 variables['openssl_is_fips'] = b(options.openssl_is_fips)
2242 variables['node_fipsinstall'] = b(False)
2243
2244 if options.openssl_no_asm:
2245 variables['openssl_no_asm'] = 1
2246
2247 o['defines'] += ['NODE_OPENSSL_CONF_NAME=' + options.openssl_conf_name]
2248
2249 if options.without_ssl:
2250 def without_ssl_error(option):
2251 error(f'--without-ssl is incompatible with {option}')
2252 if options.shared_openssl:
2253 without_ssl_error('--shared-openssl')
2254 if options.openssl_no_asm:
2255 without_ssl_error('--openssl-no-asm')
2256 if options.openssl_is_fips:
2257 without_ssl_error('--openssl-is-fips')
2258 if options.openssl_default_cipher_list:
2259 without_ssl_error('--openssl-default-cipher-list')
2260 return
2261
2262 if options.use_openssl_ca_store:
2263 o['defines'] += ['NODE_OPENSSL_CERT_STORE']
2264 if options.openssl_system_ca_path:
2265 variables['openssl_system_ca_path'] = options.openssl_system_ca_path
2266 variables['node_without_node_options'] = b(options.without_node_options)
2267 if options.without_node_options:
2268 o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
2269 if options.openssl_default_cipher_list:
2270 variables['openssl_default_cipher_list'] = \
2271 options.openssl_default_cipher_list
2272
2273 if not options.shared_openssl and not options.openssl_no_asm:
2274 is_x86 = 'x64' in variables['target_arch'] or 'ia32' in variables['target_arch']
2275
2276 # supported asm compiler for AVX2. See https://github.com/openssl/openssl/
2277 # blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
2278 openssl110_asm_supported = \
2279 ('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
2280 ('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
2281 ('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
2282 ('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))
2283
2284 if is_x86 and not openssl110_asm_supported:
2285 error('''Did not find a new enough assembler, install one or build with
2286 --openssl-no-asm.
2287 Please refer to BUILDING.md''')
2288
2289 elif options.openssl_no_asm:
2290 warn('''--openssl-no-asm will result in binaries that do not take advantage
2291 of modern CPU cryptographic instructions and will therefore be slower.
2292 Please refer to BUILDING.md''')

Callers 1

configure.pyFile · 0.85

Calls 7

VersionClass · 0.90
without_ssl_errorFunction · 0.85
configure_libraryFunction · 0.85
get_openssl_versionFunction · 0.85
bFunction · 0.70
errorFunction · 0.70
warnFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…