Skip to content

Commit

Permalink
src: remove pre-openssl 1.0 legacy code
Browse files Browse the repository at this point in the history
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: #6582
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis authored and evanlucas committed May 17, 2016
1 parent e8c9f01 commit 62593bd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) { \
Expand Down Expand Up @@ -351,7 +345,7 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
SecureContext* sc = Unwrap<SecureContext>(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]);
Expand Down Expand Up @@ -1969,7 +1963,7 @@ void SSLWrap<Base>::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) {
Base* w = Unwrap<Base>(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;

Expand Down

0 comments on commit 62593bd

Please sign in to comment.