Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5fd0f9a

Browse filesBrowse files
aglItalo A. Casas
authored andcommitted
crypto: freelist_max_len is gone in OpenSSL 1.1.0
The freelist_max_len member of SSL* (and the freelist itself) has been removed in OpenSSL 1.1.0. Thus this change will be necessary at some point but, for now, it makes it a little easier to build with 1.1.0 without breaking anything for previous versions of OpenSSL. PR-URL: #10859 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
1 parent 9d5170f commit 5fd0f9a
Copy full SHA for 5fd0f9a

File tree

Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Open diff view settings
Collapse file

‎lib/_tls_common.js‎

Copy file name to clipboardExpand all lines: lib/_tls_common.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ exports.createSecureContext = function createSecureContext(options, context) {
134134
}
135135
}
136136

137-
// Do not keep read/write buffers in free list
137+
// Do not keep read/write buffers in free list for OpenSSL < 1.1.0. (For
138+
// OpenSSL 1.1.0, buffers are malloced and freed without the use of a
139+
// freelist.)
138140
if (options.singleUse) {
139141
c.singleUse = true;
140142
c.context.setFreeListLength(0);
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,10 +1147,14 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) {
11471147

11481148

11491149
void SecureContext::SetFreeListLength(const FunctionCallbackInfo<Value>& args) {
1150+
#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(OPENSSL_IS_BORINGSSL)
1151+
// |freelist_max_len| was removed in OpenSSL 1.1.0. In that version OpenSSL
1152+
// mallocs and frees buffers directly, without the use of a freelist.
11501153
SecureContext* wrap;
11511154
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
11521155

11531156
wrap->ctx_->freelist_max_len = args[0]->Int32Value();
1157+
#endif
11541158
}
11551159

11561160

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.