src: unify crypto constant setup · nodejs/node@a3f30a4 (original) (raw)

`@@ -795,7 +795,7 @@ void DefinePriorityConstants(Local target) {

`

795

795

`#endif

`

796

796

`}

`

797

797

``

798

``

`-

void DefineOpenSSLConstants(Local target) {

`

``

798

`+

void DefineCryptoConstants(Local target) {

`

799

799

`#ifdef OPENSSL_VERSION_NUMBER

`

800

800

`NODE_DEFINE_CONSTANT(target, OPENSSL_VERSION_NUMBER);

`

801

801

`#endif

`

`@@ -1041,13 +1041,44 @@ void DefineOpenSSLConstants(Local target) {

`

1041

1041

`NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_AUTO);

`

1042

1042

`#endif

`

1043

1043

``

``

1044

`+

#ifdef DEFAULT_CIPHER_LIST_CORE

`

``

1045

`+

NODE_DEFINE_STRING_CONSTANT(target,

`

``

1046

`+

"defaultCoreCipherList",

`

``

1047

`+

DEFAULT_CIPHER_LIST_CORE);

`

``

1048

`+

#endif

`

``

1049

+

``

1050

`+

#ifdef TLS1_VERSION

`

``

1051

`+

NODE_DEFINE_CONSTANT(target, TLS1_VERSION);

`

``

1052

`+

#endif

`

``

1053

+

``

1054

`+

#ifdef TLS1_1_VERSION

`

``

1055

`+

NODE_DEFINE_CONSTANT(target, TLS1_1_VERSION);

`

``

1056

`+

#endif

`

``

1057

+

``

1058

`+

#ifdef TLS1_2_VERSION

`

``

1059

`+

NODE_DEFINE_CONSTANT(target, TLS1_2_VERSION);

`

``

1060

`+

#endif

`

``

1061

+

``

1062

`+

#ifdef TLS1_3_VERSION

`

``

1063

`+

NODE_DEFINE_CONSTANT(target, TLS1_3_VERSION);

`

``

1064

`+

#endif

`

``

1065

+

``

1066

`+

// Unused by node, but removing it is semver-major.

`

``

1067

`+

NODE_DEFINE_CONSTANT(target, INT_MAX);

`

``

1068

+

1044

1069

`#if HAVE_OPENSSL

`

1045

1070

`// NOTE: These are not defines

`

1046

1071

`NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_COMPRESSED);

`

1047

1072

``

1048

1073

`NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_UNCOMPRESSED);

`

1049

1074

``

1050

1075

`NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_HYBRID);

`

``

1076

+

``

1077

`+

NODE_DEFINE_STRING_CONSTANT(

`

``

1078

`+

target,

`

``

1079

`+

"defaultCipherList",

`

``

1080

`+

per_process::cli_options->tls_cipher_list.c_str());

`

``

1081

+

1051

1082

`#endif

`

1052

1083

`}

`

1053

1084

``

`@@ -1232,24 +1263,6 @@ void DefineSystemConstants(Local target) {

`

1232

1263

`#endif

`

1233

1264

`}

`

1234

1265

``

1235

``

`-

void DefineCryptoConstants(Local target) {

`

1236

``

`-

#if HAVE_OPENSSL

`

1237

``

`-

NODE_DEFINE_STRING_CONSTANT(target,

`

1238

``

`-

"defaultCoreCipherList",

`

1239

``

`-

DEFAULT_CIPHER_LIST_CORE);

`

1240

``

`-

NODE_DEFINE_STRING_CONSTANT(

`

1241

``

`-

target,

`

1242

``

`-

"defaultCipherList",

`

1243

``

`-

per_process::cli_options->tls_cipher_list.c_str());

`

1244

``

-

1245

``

`-

NODE_DEFINE_CONSTANT(target, TLS1_VERSION);

`

1246

``

`-

NODE_DEFINE_CONSTANT(target, TLS1_1_VERSION);

`

1247

``

`-

NODE_DEFINE_CONSTANT(target, TLS1_2_VERSION);

`

1248

``

`-

NODE_DEFINE_CONSTANT(target, TLS1_3_VERSION);

`

1249

``

`-

#endif

`

1250

``

`-

NODE_DEFINE_CONSTANT(target, INT_MAX);

`

1251

``

`-

}

`

1252

``

-

1253

1266

`void DefineDLOpenConstants(Local target) {

`

1254

1267

`#ifdef RTLD_LAZY

`

1255

1268

`NODE_DEFINE_CONSTANT(target, RTLD_LAZY);

`

`@@ -1347,7 +1360,6 @@ void DefineConstants(v8::Isolate* isolate, Local target) {

`

1347

1360

`DefineSignalConstants(sig_constants);

`

1348

1361

`DefinePriorityConstants(priority_constants);

`

1349

1362

`DefineSystemConstants(fs_constants);

`

1350

``

`-

DefineOpenSSLConstants(crypto_constants);

`

1351

1363

`DefineCryptoConstants(crypto_constants);

`

1352

1364

`DefineZlibConstants(zlib_constants);

`

1353

1365

`DefineDLOpenConstants(dlopen_constants);

`