lib,src: remove openssl feature conditionals · nodejs/node@a657984
@@ -133,24 +133,17 @@ template int SSLWrap<TLSWrap>::NewSessionCallback(SSL* s,
133133template void SSLWrap<TLSWrap>::OnClientHello(
134134void* arg,
135135const ClientHelloParser::ClientHello& hello);
136-137-#ifdef NODE__HAVE_TLSEXT_STATUS_CB
138136template int SSLWrap<TLSWrap>::TLSExtStatusCallback(SSL* s, void* arg);
139-#endif
140-141137template void SSLWrap<TLSWrap>::DestroySSL();
142138template int SSLWrap<TLSWrap>::SSLCertCallback(SSL* s, void* arg);
143139template void SSLWrap<TLSWrap>::WaitForCertCb(CertCb cb, void* arg);
144-145-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
146140template int SSLWrap<TLSWrap>::SelectALPNCallback(
147141SSL* s,
148142const unsigned char** out,
149143unsigned char* outlen,
150144const unsigned char* in,
151145unsigned int inlen,
152146void* arg);
153-#endif // TLSEXT_TYPE_application_layer_protocol_negotiation
154147155148156149static int PasswordCallback(char* buf, int size, int rwflag, void* u) {
@@ -1387,11 +1380,9 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
1387138013881381template <class Base>
13891382void SSLWrap<Base>::ConfigureSecureContext(SecureContext* sc) {
1390-#ifdef NODE__HAVE_TLSEXT_STATUS_CB
13911383// OCSP stapling
13921384SSL_CTX_set_tlsext_status_cb(sc->ctx_.get(), TLSExtStatusCallback);
13931385SSL_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) {
2019201020202011template <class Base>
20212012void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {
2022-#ifdef NODE__HAVE_TLSEXT_STATUS_CB
20232013 Base* w;
20242014ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
20252015 Environment* env = w->env();
@@ -2030,18 +2020,15 @@ void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {
20302020THROW_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}
203520242036202520372026template <class Base>
20382027void SSLWrap<Base>::RequestOCSP(const FunctionCallbackInfo<Value>& args) {
2039-#ifdef NODE__HAVE_TLSEXT_STATUS_CB
20402028 Base* w;
20412029ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
2042203020432031SSL_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
22302216template <class Base>
22312217int SSLWrap<Base>::SelectALPNCallback(SSL* s,
22322218const unsigned char** out,
@@ -2256,13 +2242,11 @@ int SSLWrap<Base>::SelectALPNCallback(SSL* s,
22562242return status == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK
22572243 : SSL_TLSEXT_ERR_NOACK;
22582244}
2259-#endif // TLSEXT_TYPE_application_layer_protocol_negotiation
226022452261224622622247template <class Base>
22632248void SSLWrap<Base>::GetALPNNegotiatedProto(
22642249const FunctionCallbackInfo<Value>& args) {
2265-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
22662250 Base* w;
22672251ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
22682252@@ -2276,13 +2260,11 @@ void SSLWrap<Base>::GetALPNNegotiatedProto(
2276226022772261 args.GetReturnValue().Set(
22782262OneByteString(args.GetIsolate(), alpn_proto, alpn_proto_len));
2279-#endif // TLSEXT_TYPE_application_layer_protocol_negotiation
22802263}
228122642282226522832266template <class Base>
22842267void SSLWrap<Base>::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) {
2285-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
22862268 Base* w;
22872269ASSIGN_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,
23072289nullptr);
23082290 }
2309-#endif // TLSEXT_TYPE_application_layer_protocol_negotiation
23102291}
23112292231222932313-#ifdef NODE__HAVE_TLSEXT_STATUS_CB
23142294template <class Base>
23152295int 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) {
23542334return SSL_TLSEXT_ERR_OK;
23552335 }
23562336}
2357-#endif // NODE__HAVE_TLSEXT_STATUS_CB
235823372359233823602339template <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(),
24052380Boolean::New(env->isolate(), ocsp)).FromJust();
24062381