summaryrefslogtreecommitdiff
path: root/src/node_crypto.h
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-06-03 00:10:01 +0200
committerAnna Henningsen <anna@addaleax.net>2019-06-10 18:23:12 +0200
commit94a7c2ab8a191097e28749c44b3aefd2ba6920ee (patch)
tree8f5d7352b77656c87f5862a058b743c51b90008a /src/node_crypto.h
parentd1dd4e10db5cb163f265a1abd1f5952f60a81e09 (diff)
downloadandroid-node-v8-94a7c2ab8a191097e28749c44b3aefd2ba6920ee.tar.gz
android-node-v8-94a7c2ab8a191097e28749c44b3aefd2ba6920ee.tar.bz2
android-node-v8-94a7c2ab8a191097e28749c44b3aefd2ba6920ee.zip
src: remove TLS code for unsupported OpenSSLs
Versions of OpenSSL lower than 1.1.1 are no longer supported, so remove ifdefs for previous versions. PR-URL: https://github.com/nodejs/node/pull/28085 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r--src/node_crypto.h35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 849b80f4e0..aa29585533 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -108,20 +108,13 @@ class SecureContext : public BaseObject {
static const int kTicketKeyNameIndex = 3;
static const int kTicketKeyIVIndex = 4;
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
unsigned char ticket_key_name_[16];
unsigned char ticket_key_aes_[16];
unsigned char ticket_key_hmac_[16];
-#endif
protected:
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- static const int64_t kExternalSize = sizeof(SSL_CTX);
-#else
- // OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
- // as of OpenSSL 1.1.0f.
- static const int64_t kExternalSize = 872;
-#endif
+ // OpenSSL structures are opaque. This is sizeof(SSL_CTX) for OpenSSL 1.1.1b:
+ static const int64_t kExternalSize = 1024;
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Init(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -167,14 +160,12 @@ class SecureContext : public BaseObject {
HMAC_CTX* hctx,
int enc);
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
static int TicketCompatibilityCallback(SSL* ssl,
unsigned char* name,
unsigned char* iv,
EVP_CIPHER_CTX* ectx,
HMAC_CTX* hctx,
int enc);
-#endif
SecureContext(Environment* env, v8::Local<v8::Object> wrap)
: BaseObject(env, wrap) {
@@ -229,32 +220,20 @@ class SSLWrap {
protected:
typedef void (*CertCb)(void* arg);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- // Size allocated by OpenSSL: one for SSL structure, one for SSL3_STATE and
- // some for buffers.
+ // OpenSSL structures are opaque. Estimate SSL memory size for OpenSSL 1.1.1b:
+ // SSL: 6224
+ // SSL->SSL3_STATE: 1040
+ // ...some buffers: 42 * 1024
// NOTE: Actually it is much more than this
- static const int64_t kExternalSize =
- sizeof(SSL) + sizeof(SSL3_STATE) + 42 * 1024;
-#else
- // OpenSSL 1.1.0 has opaque structures. This is an estimate based on the size
- // as of OpenSSL 1.1.0f.
- static const int64_t kExternalSize = 4448 + 1024 + 42 * 1024;
-#endif
+ static const int64_t kExternalSize = 6224 + 1040 + 42 * 1024;
static void ConfigureSecureContext(SecureContext* sc);
static void AddMethods(Environment* env, v8::Local<v8::FunctionTemplate> t);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- static SSL_SESSION* GetSessionCallback(SSL* s,
- unsigned char* key,
- int len,
- int* copy);
-#else
static SSL_SESSION* GetSessionCallback(SSL* s,
const unsigned char* key,
int len,
int* copy);
-#endif
static int NewSessionCallback(SSL* s, SSL_SESSION* sess);
static void KeylogCallback(const SSL* s, const char* line);
static void OnClientHello(void* arg,