@@ -108,20 +108,13 @@ class SecureContext : public BaseObject {
108
108
static const int kTicketKeyNameIndex = 3 ;
109
109
static const int kTicketKeyIVIndex = 4 ;
110
110
111
- #if OPENSSL_VERSION_NUMBER >= 0x10100000L
112
111
unsigned char ticket_key_name_[16 ];
113
112
unsigned char ticket_key_aes_[16 ];
114
113
unsigned char ticket_key_hmac_[16 ];
115
- #endif
116
114
117
115
protected:
118
- #if OPENSSL_VERSION_NUMBER < 0x10100000L
119
- static const int64_t kExternalSize = sizeof (SSL_CTX);
120
- #else
121
- // OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
122
- // as of OpenSSL 1.1.0f.
123
- static const int64_t kExternalSize = 872 ;
124
- #endif
116
+ // OpenSSL structures are opaque. This is sizeof(SSL_CTX) for OpenSSL 1.1.1b:
117
+ static const int64_t kExternalSize = 1024 ;
125
118
126
119
static void New (const v8::FunctionCallbackInfo<v8::Value>& args);
127
120
static void Init (const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -167,14 +160,12 @@ class SecureContext : public BaseObject {
167
160
HMAC_CTX* hctx,
168
161
int enc);
169
162
170
- #if OPENSSL_VERSION_NUMBER >= 0x10100000L
171
163
static int TicketCompatibilityCallback (SSL* ssl,
172
164
unsigned char * name,
173
165
unsigned char * iv,
174
166
EVP_CIPHER_CTX* ectx,
175
167
HMAC_CTX* hctx,
176
168
int enc);
177
- #endif
178
169
179
170
SecureContext (Environment* env, v8::Local<v8::Object> wrap)
180
171
: BaseObject(env, wrap) {
@@ -229,32 +220,20 @@ class SSLWrap {
229
220
protected:
230
221
typedef void (*CertCb)(void * arg);
231
222
232
- #if OPENSSL_VERSION_NUMBER < 0x10100000L
233
- // Size allocated by OpenSSL: one for SSL structure, one for SSL3_STATE and
234
- // some for buffers.
223
+ // OpenSSL structures are opaque. Estimate SSL memory size for OpenSSL 1.1.1b:
224
+ // SSL: 6224
225
+ // SSL->SSL3_STATE: 1040
226
+ // ...some buffers: 42 * 1024
235
227
// NOTE: Actually it is much more than this
236
- static const int64_t kExternalSize =
237
- sizeof (SSL) + sizeof (SSL3_STATE) + 42 * 1024 ;
238
- #else
239
- // OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
240
- // as of OpenSSL 1.1.0f.
241
- static const int64_t kExternalSize = 4448 + 1024 + 42 * 1024 ;
242
- #endif
228
+ static const int64_t kExternalSize = 6224 + 1040 + 42 * 1024 ;
243
229
244
230
static void ConfigureSecureContext (SecureContext* sc);
245
231
static void AddMethods (Environment* env, v8::Local<v8::FunctionTemplate> t);
246
232
247
- #if OPENSSL_VERSION_NUMBER < 0x10100000L
248
- static SSL_SESSION* GetSessionCallback (SSL* s,
249
- unsigned char * key,
250
- int len,
251
- int * copy);
252
- #else
253
233
static SSL_SESSION* GetSessionCallback (SSL* s,
254
234
const unsigned char * key,
255
235
int len,
256
236
int * copy);
257
- #endif
258
237
static int NewSessionCallback (SSL* s, SSL_SESSION* sess);
259
238
static void KeylogCallback (const SSL* s, const char * line);
260
239
static void OnClientHello (void * arg,
0 commit comments