| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0716944 commit 8984b73
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5564,12 +5564,6 @@ void DiffieHellman::SetPublicKey(const FunctionCallbackInfo<Value>& args) { | |||
| 5564 | 5564 | } | |
| 5565 | 5565 | ||
| 5566 | 5566 | void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo<Value>& args) { | |
| 5567 | - #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ | ||
| 5568 | - OPENSSL_VERSION_NUMBER < 0x10100070L | ||
| 5569 | - // Older versions of OpenSSL 1.1.0 have a DH_set0_key which does not work for | ||
| 5570 | - // Node. See https://github.com/openssl/openssl/pull/4384. | ||
| 5571 | - #error "OpenSSL 1.1.0 revisions before 1.1.0g are not supported" | ||
| 5572 | - #endif | ||
| 5573 | 5567 | SetKey(args, | |
| 5574 | 5568 | [](DH* dh, BIGNUM* num) { return DH_set0_key(dh, nullptr, num); }, | |
| 5575 | 5569 | "Private key"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,16 +30,6 @@ | |||
| 30 | 30 | namespace node { | |
| 31 | 31 | namespace crypto { | |
| 32 | 32 | ||
| 33 | - #if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
| 34 | - #define BIO_set_data(bio, data) bio->ptr = data | ||
| 35 | - #define BIO_get_data(bio) bio->ptr | ||
| 36 | - #define BIO_set_shutdown(bio, shutdown_) bio->shutdown = shutdown_ | ||
| 37 | - #define BIO_get_shutdown(bio) bio->shutdown | ||
| 38 | - #define BIO_set_init(bio, init_) bio->init = init_ | ||
| 39 | - #define BIO_get_init(bio) bio->init | ||
| 40 | - #endif | ||
| 41 | - | ||
| 42 | - | ||
| 43 | 33 | BIOPointer NodeBIO::New(Environment* env) { | |
| 44 | 34 | BIOPointer bio(BIO_new(GetMethod())); | |
| 45 | 35 | if (bio && env != nullptr) | |
@@ -231,22 +221,6 @@ long NodeBIO::Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) | |||
| 231 | 221 | ||
| 232 | 222 | ||
| 233 | 223 | const BIO_METHOD* NodeBIO::GetMethod() { | |
| 234 | - #if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
| 235 | - static const BIO_METHOD method = { | ||
| 236 | - BIO_TYPE_MEM, | ||
| 237 | - "node.js SSL buffer", | ||
| 238 | - Write, | ||
| 239 | - Read, | ||
| 240 | - Puts, | ||
| 241 | - Gets, | ||
| 242 | - Ctrl, | ||
| 243 | - New, | ||
| 244 | - Free, | ||
| 245 | - nullptr | ||
| 246 | - }; | ||
| 247 | - | ||
| 248 | - return &method; | ||
| 249 | - #else | ||
| 250 | 224 | // This is called from InitCryptoOnce() to avoid race conditions during | |
| 251 | 225 | // initialization. | |
| 252 | 226 | static BIO_METHOD* method = nullptr; | |
@@ -263,7 +237,6 @@ const BIO_METHOD* NodeBIO::GetMethod() { | |||
| 263 | 237 | } | |
| 264 | 238 | ||
| 265 | 239 | return method; | |
| 266 | - #endif | ||
| 267 | 240 | } | |
| 268 | 241 | ||
| 269 | 242 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments