Skip to content

Commit 62593bd

Browse files
bnoordhuisevanlucas
authored andcommitted
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 <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e8c9f01 commit 62593bd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/node_crypto.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
#define strcasecmp _stricmp
2929
#endif
3030

31-
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
32-
#define OPENSSL_CONST const
33-
#else
34-
#define OPENSSL_CONST
35-
#endif
36-
3731
#define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \
3832
do { \
3933
if (!Buffer::HasInstance(val) && !val->IsString()) { \
@@ -351,7 +345,7 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
351345
SecureContext* sc = Unwrap<SecureContext>(args.Holder());
352346
Environment* env = sc->env();
353347

354-
OPENSSL_CONST SSL_METHOD *method = SSLv23_method();
348+
const SSL_METHOD* method = SSLv23_method();
355349

356350
if (args.Length() == 1 && args[0]->IsString()) {
357351
const node::Utf8Value sslmethod(env->isolate(), args[0]);
@@ -1969,7 +1963,7 @@ void SSLWrap<Base>::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) {
19691963
Base* w = Unwrap<Base>(args.Holder());
19701964
Environment* env = w->ssl_env();
19711965

1972-
OPENSSL_CONST SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_);
1966+
const SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_);
19731967
if (c == nullptr)
19741968
return;
19751969

0 commit comments

Comments
 (0)