@@ -147,7 +147,7 @@ index 6e5bbe07d0c337b36f3157c2e6404fdc91849fd1..7ec682833213de9054a8c30751436d12
147
147
DHPointer dh;
148
148
{
149
149
diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc
150
- index b4447102a8478639a5aa774e583834d79808603f..d3dad0ae8a9810e8481529776f4ed4686a8d9c53 100644
150
+ index b4447102a8478639a5aa774e583834d79808603f..678be07feb394530b944c1b356265416f2d50742 100644
151
151
--- a/src/crypto/crypto_dh.cc
152
152
+++ b/src/crypto/crypto_dh.cc
153
153
@@ -154,13 +154,11 @@ bool DiffieHellman::Init(BignumPointer&& bn_p, int g) {
@@ -166,7 +166,7 @@ index b4447102a8478639a5aa774e583834d79808603f..d3dad0ae8a9810e8481529776f4ed468
166
166
return false;
167
167
}
168
168
BignumPointer bn_p(
169
- @@ -176,18 +174,17 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
169
+ @@ -176,20 +174,17 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) {
170
170
bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) {
171
171
dh_.reset(DH_new());
172
172
if (p_len <= 0) {
@@ -184,11 +184,13 @@ index b4447102a8478639a5aa774e583834d79808603f..d3dad0ae8a9810e8481529776f4ed468
184
184
BignumPointer bn_g(
185
185
BN_bin2bn(reinterpret_cast<const unsigned char*>(g), g_len, nullptr));
186
186
if (BN_is_zero(bn_g.get()) || BN_is_one(bn_g.get())) {
187
+ - ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS,
188
+ - DH_R_BAD_GENERATOR, __FILE__, __LINE__);
187
189
+ OPENSSL_PUT_ERROR(DH, DH_R_BAD_GENERATOR);
188
- ERR_put_error(ERR_LIB_DH, DH_F_DH_BUILTIN_GENPARAMS,
189
- DH_R_BAD_GENERATOR, __FILE__, __LINE__);
190
190
return false;
191
- @@ -219,8 +216,10 @@ typedef BignumPointer (*StandardizedGroupInstantiator)();
191
+ }
192
+ BignumPointer bn_p(
193
+ @@ -219,8 +214,10 @@ typedef BignumPointer (*StandardizedGroupInstantiator)();
192
194
inline StandardizedGroupInstantiator FindDiffieHellmanGroup(const char* name) {
193
195
#define V(n, p) \
194
196
if (StringEqualNoCase(name, n)) return InstantiateStandardizedGroup<p>
@@ -199,7 +201,7 @@ index b4447102a8478639a5aa774e583834d79808603f..d3dad0ae8a9810e8481529776f4ed468
199
201
V("modp5", BN_get_rfc3526_prime_1536);
200
202
V("modp14", BN_get_rfc3526_prime_2048);
201
203
V("modp15", BN_get_rfc3526_prime_3072);
202
- @@ -559,15 +558 ,20 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
204
+ @@ -559,15 +556 ,20 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
203
205
return EVPKeyCtxPointer();
204
206
}
205
207
@@ -220,7 +222,7 @@ index b4447102a8478639a5aa774e583834d79808603f..d3dad0ae8a9810e8481529776f4ed468
220
222
if (!param_ctx ||
221
223
EVP_PKEY_paramgen_init(param_ctx.get()) <= 0 ||
222
224
EVP_PKEY_CTX_set_dh_paramgen_prime_len(
223
- @@ -581,6 +585 ,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
225
+ @@ -581,6 +583 ,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
224
226
}
225
227
226
228
key_params = EVPKeyPointer(raw_params);
@@ -370,6 +372,28 @@ index 5734d8fdc5505e1586f571c19b840bd56e9c9f1f..3034b114e081e2b32dd5b71653927a41
370
372
}
371
373
} // namespace
372
374
375
+ diff --git a/src/env.h b/src/env.h
376
+ index 994b9573822fd3eb0588e87edaa0e505aa5102fb..bb84f5ab43cb5be42019921e5dc2fc010d7b9018 100644
377
+ --- a/src/env.h
378
+ +++ b/src/env.h
379
+ @@ -49,7 +49,7 @@
380
+ #include "uv.h"
381
+ #include "v8.h"
382
+
383
+ - #if HAVE_OPENSSL
384
+ + #if HAVE_OPENSSL && OPENSSL_VERSION_MAJOR >= 3
385
+ #include <openssl/evp.h>
386
+ #endif
387
+
388
+ @@ -1032,7 +1032,7 @@ class Environment : public MemoryRetainer {
389
+ kExitInfoFieldCount
390
+ };
391
+
392
+ - #if HAVE_OPENSSL
393
+ + #if HAVE_OPENSSL// && !defined(OPENSSL_IS_BORINGSSL)
394
+ #if OPENSSL_VERSION_MAJOR >= 3
395
+ // We declare another alias here to avoid having to include crypto_util.h
396
+ using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
373
397
diff --git a/src/node.cc b/src/node.cc
374
398
index 10e04ed8a28bd010e4887ad5b9af3886f7b32a53..012dd487e8db232d068bce358ad44b14e78d0fe9 100644
375
399
--- a/src/node.cc
0 commit comments