Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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: #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 committed May 4, 2016
commit b261178a5204ca38183af9fe6c32720e46d84b51
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