◐ Shell
clean mode source ↗

lib,src: remove openssl feature conditionals · nodejs/node@a657984

@@ -133,24 +133,17 @@ template int SSLWrap<TLSWrap>::NewSessionCallback(SSL* s,

133133

template void SSLWrap<TLSWrap>::OnClientHello(

134134

void* arg,

135135

const ClientHelloParser::ClientHello& hello);

136-137-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

138136

template int SSLWrap<TLSWrap>::TLSExtStatusCallback(SSL* s, void* arg);

139-

#endif

140-141137

template void SSLWrap<TLSWrap>::DestroySSL();

142138

template int SSLWrap<TLSWrap>::SSLCertCallback(SSL* s, void* arg);

143139

template void SSLWrap<TLSWrap>::WaitForCertCb(CertCb cb, void* arg);

144-145-

#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation

146140

template int SSLWrap<TLSWrap>::SelectALPNCallback(

147141

SSL* s,

148142

const unsigned char** out,

149143

unsigned char* outlen,

150144

const unsigned char* in,

151145

unsigned int inlen,

152146

void* arg);

153-

#endif // TLSEXT_TYPE_application_layer_protocol_negotiation

154147155148156149

static int PasswordCallback(char* buf, int size, int rwflag, void* u) {

@@ -1387,11 +1380,9 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {

1387138013881381

template <class Base>

13891382

void SSLWrap<Base>::ConfigureSecureContext(SecureContext* sc) {

1390-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

13911383

// OCSP stapling

13921384

SSL_CTX_set_tlsext_status_cb(sc->ctx_.get(), TLSExtStatusCallback);

13931385

SSL_CTX_set_tlsext_status_arg(sc->ctx_.get(), nullptr);

1394-

#endif // NODE__HAVE_TLSEXT_STATUS_CB

13951386

}

1396138713971388

@@ -2019,7 +2010,6 @@ void SSLWrap<Base>::NewSessionDone(const FunctionCallbackInfo<Value>& args) {

2019201020202011

template <class Base>

20212012

void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {

2022-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

20232013

Base* w;

20242014

ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());

20252015

Environment* env = w->env();

@@ -2030,18 +2020,15 @@ void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {

20302020

THROW_AND_RETURN_IF_NOT_BUFFER(env, args[0], "OCSP response");

2031202120322022

w->ocsp_response_.Reset(args.GetIsolate(), args[0].As<Object>());

2033-

#endif // NODE__HAVE_TLSEXT_STATUS_CB

20342023

}

203520242036202520372026

template <class Base>

20382027

void SSLWrap<Base>::RequestOCSP(const FunctionCallbackInfo<Value>& args) {

2039-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

20402028

Base* w;

20412029

ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());

2042203020432031

SSL_set_tlsext_status_type(w->ssl_.get(), TLSEXT_STATUSTYPE_ocsp);

2044-

#endif // NODE__HAVE_TLSEXT_STATUS_CB

20452032

}

2046203320472034

@@ -2226,7 +2213,6 @@ void SSLWrap<Base>::GetProtocol(const FunctionCallbackInfo<Value>& args) {

22262213

}

22272214222822152229-

#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation

22302216

template <class Base>

22312217

int SSLWrap<Base>::SelectALPNCallback(SSL* s,

22322218

const unsigned char** out,

@@ -2256,13 +2242,11 @@ int SSLWrap<Base>::SelectALPNCallback(SSL* s,

22562242

return status == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK

22572243

: SSL_TLSEXT_ERR_NOACK;

22582244

}

2259-

#endif // TLSEXT_TYPE_application_layer_protocol_negotiation

226022452261224622622247

template <class Base>

22632248

void SSLWrap<Base>::GetALPNNegotiatedProto(

22642249

const FunctionCallbackInfo<Value>& args) {

2265-

#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation

22662250

Base* w;

22672251

ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());

22682252

@@ -2276,13 +2260,11 @@ void SSLWrap<Base>::GetALPNNegotiatedProto(

2276226022772261

args.GetReturnValue().Set(

22782262

OneByteString(args.GetIsolate(), alpn_proto, alpn_proto_len));

2279-

#endif // TLSEXT_TYPE_application_layer_protocol_negotiation

22802263

}

228122642282226522832266

template <class Base>

22842267

void SSLWrap<Base>::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) {

2285-

#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation

22862268

Base* w;

22872269

ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());

22882270

Environment* env = w->env();

@@ -2306,11 +2288,9 @@ void SSLWrap<Base>::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) {

23062288

SelectALPNCallback,

23072289

nullptr);

23082290

}

2309-

#endif // TLSEXT_TYPE_application_layer_protocol_negotiation

23102291

}

23112292231222932313-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

23142294

template <class Base>

23152295

int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {

23162296

Base* w = static_cast<Base*>(SSL_get_app_data(s));

@@ -2354,7 +2334,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {

23542334

return SSL_TLSEXT_ERR_OK;

23552335

}

23562336

}

2357-

#endif // NODE__HAVE_TLSEXT_STATUS_CB

235823372359233823602339

template <class Base>

@@ -2396,11 +2375,7 @@ int SSLWrap<Base>::SSLCertCallback(SSL* s, void* arg) {

23962375

info->Set(context, env->servername_string(), str).FromJust();

23972376

}

239823772399-

bool ocsp = false;

2400-

#ifdef NODE__HAVE_TLSEXT_STATUS_CB

2401-

ocsp = SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp;

2402-

#endif

2403-2378+

const bool ocsp = (SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp);

24042379

info->Set(context, env->ocsp_request_string(),

24052380

Boolean::New(env->isolate(), ocsp)).FromJust();

24062381