GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: estimate kExternalSize · nodejs/node@201393f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_crypto.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_crypto.h‎

Copy file name to clipboardExpand all lines: src/node_crypto.h
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ class SecureContext : public BaseObject {
106106
static const int kTicketKeyIVIndex = 4;
107107

108108
protected:
109+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
109110
static const int64_t kExternalSize = sizeof(SSL_CTX);
111+
#else
112+
// OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
113+
// as of OpenSSL 1.1.0f.
114+
static const int64_t kExternalSize = 872;
115+
#endif
110116

111117
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
112118
static void Init(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -220,11 +226,17 @@ class SSLWrap {
220226
protected:
221227
typedef void (*CertCb)(void* arg);
222228

229+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
223230
// Size allocated by OpenSSL: one for SSL structure, one for SSL3_STATE and
224231
// some for buffers.
225232
// NOTE: Actually it is much more than this
226233
static const int64_t kExternalSize =
227234
sizeof(SSL) + sizeof(SSL3_STATE) + 42 * 1024;
235+
#else
236+
// OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
237+
// as of OpenSSL 1.1.0f.
238+
static const int64_t kExternalSize = 4448 + 1024 + 42 * 1024;
239+
#endif
228240

229241
static void InitNPN(SecureContext* sc);
230242
static void AddMethods(Environment* env, v8::Local<v8::FunctionTemplate> t);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.