Skip to content

Commit 84ba54f

Browse files
committed
chore: update fix_handle_boringssl_and_openssl_incompatibilities.patch
Upstream used `BIO_s_secmem()`, a secure heap variant of `BIO_s_mem()`. BoringSSL doesn't support it, so this PR opts for `BIO_s_mem()` instead. Upstream Node.js change that prompted this: nodejs/node#47160 Related discussion of BoringSSL support of secure heap: https://boringssl-review.googlesource.com/c/boringssl/+/54309
1 parent f8d58c9 commit 84ba54f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,18 @@ index 41e607e9298314bd7dd9e61643650f3ec75caea8..bd3228a67e1bda671488b347bd53ca80
104104
if (!Set(env->context(),
105105
obj,
106106
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
107-
index 838ee2a68dffc5a2aeca2bdb51b076795b2b145f..64d17d7480ee29390022600fb838b52abe25893d 100644
107+
index 838ee2a68dffc5a2aeca2bdb51b076795b2b145f..b0b18cd30c854c8c30d74afbf3ed352d3d23f30d 100644
108108
--- a/src/crypto/crypto_context.cc
109109
+++ b/src/crypto/crypto_context.cc
110+
@@ -63,7 +63,7 @@ inline X509_STORE* GetOrCreateRootCertStore() {
111+
// Caller responsible for BIO_free_all-ing the returned object.
112+
BIOPointer LoadBIO(Environment* env, Local<Value> v) {
113+
if (v->IsString() || v->IsArrayBufferView()) {
114+
- BIOPointer bio(BIO_new(BIO_s_secmem()));
115+
+ BIOPointer bio(BIO_new(BIO_s_mem()));
116+
if (!bio) return nullptr;
117+
ByteSource bsrc = ByteSource::FromStringOrBuffer(env, v);
118+
if (bsrc.size() > INT_MAX) return nullptr;
110119
@@ -855,10 +855,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
111120
// If the user specified "auto" for dhparams, the JavaScript layer will pass
112121
// true to this function instead of the original string. Any other string

0 commit comments

Comments
 (0)