From 62593bd44c6ef63db5f38e65e0623f667181ec32 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 4 May 2016 20:35:24 +0200 Subject: [PATCH] src: remove pre-openssl 1.0 legacy code SSL_CIPHER and SSL_METHOD are always const with the version of openssl that we support, no need to check OPENSSL_VERSION_NUMBER first. PR-URL: https://github.com/nodejs/node/pull/6582 Reviewed-By: Anna Henningsen Reviewed-By: Fedor Indutny Reviewed-By: James M Snell --- src/node_crypto.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index d46e8a42a9143d..d50671aa760e2b 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -28,12 +28,6 @@ #define strcasecmp _stricmp #endif -#if OPENSSL_VERSION_NUMBER >= 0x10000000L -#define OPENSSL_CONST const -#else -#define OPENSSL_CONST -#endif - #define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \ do { \ if (!Buffer::HasInstance(val) && !val->IsString()) { \ @@ -351,7 +345,7 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { SecureContext* sc = Unwrap(args.Holder()); Environment* env = sc->env(); - OPENSSL_CONST SSL_METHOD *method = SSLv23_method(); + const SSL_METHOD* method = SSLv23_method(); if (args.Length() == 1 && args[0]->IsString()) { const node::Utf8Value sslmethod(env->isolate(), args[0]); @@ -1969,7 +1963,7 @@ void SSLWrap::GetCurrentCipher(const FunctionCallbackInfo& args) { Base* w = Unwrap(args.Holder()); Environment* env = w->ssl_env(); - OPENSSL_CONST SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_); + const SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_); if (c == nullptr) return;