@@ -133,24 +133,17 @@ template int SSLWrap<TLSWrap>::NewSessionCallback(SSL* s,
133
133
template void SSLWrap<TLSWrap>::OnClientHello(
134
134
void * arg,
135
135
const ClientHelloParser::ClientHello& hello);
136
-
137
- #ifdef NODE__HAVE_TLSEXT_STATUS_CB
138
136
template int SSLWrap<TLSWrap>::TLSExtStatusCallback(SSL* s, void * arg);
139
- #endif
140
-
141
137
template void SSLWrap<TLSWrap>::DestroySSL();
142
138
template int SSLWrap<TLSWrap>::SSLCertCallback(SSL* s, void * arg);
143
139
template void SSLWrap<TLSWrap>::WaitForCertCb(CertCb cb, void * arg);
144
-
145
- #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
146
140
template int SSLWrap<TLSWrap>::SelectALPNCallback(
147
141
SSL* s,
148
142
const unsigned char ** out,
149
143
unsigned char * outlen,
150
144
const unsigned char * in,
151
145
unsigned int inlen,
152
146
void * arg);
153
- #endif // TLSEXT_TYPE_application_layer_protocol_negotiation
154
147
155
148
156
149
static int PasswordCallback (char * buf, int size, int rwflag, void * u) {
@@ -1387,11 +1380,9 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
1387
1380
1388
1381
template <class Base >
1389
1382
void SSLWrap<Base>::ConfigureSecureContext(SecureContext* sc) {
1390
- #ifdef NODE__HAVE_TLSEXT_STATUS_CB
1391
1383
// OCSP stapling
1392
1384
SSL_CTX_set_tlsext_status_cb (sc->ctx_ .get (), TLSExtStatusCallback);
1393
1385
SSL_CTX_set_tlsext_status_arg (sc->ctx_ .get (), nullptr );
1394
- #endif // NODE__HAVE_TLSEXT_STATUS_CB
1395
1386
}
1396
1387
1397
1388
@@ -2019,7 +2010,6 @@ void SSLWrap<Base>::NewSessionDone(const FunctionCallbackInfo<Value>& args) {
2019
2010
2020
2011
template <class Base >
2021
2012
void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {
2022
- #ifdef NODE__HAVE_TLSEXT_STATUS_CB
2023
2013
Base* w;
2024
2014
ASSIGN_OR_RETURN_UNWRAP (&w, args.Holder ());
2025
2015
Environment* env = w->env ();
@@ -2030,18 +2020,15 @@ void SSLWrap<Base>::SetOCSPResponse(const FunctionCallbackInfo<Value>& args) {
2030
2020
THROW_AND_RETURN_IF_NOT_BUFFER (env, args[0 ], " OCSP response" );
2031
2021
2032
2022
w->ocsp_response_ .Reset (args.GetIsolate (), args[0 ].As <Object>());
2033
- #endif // NODE__HAVE_TLSEXT_STATUS_CB
2034
2023
}
2035
2024
2036
2025
2037
2026
template <class Base >
2038
2027
void SSLWrap<Base>::RequestOCSP(const FunctionCallbackInfo<Value>& args) {
2039
- #ifdef NODE__HAVE_TLSEXT_STATUS_CB
2040
2028
Base* w;
2041
2029
ASSIGN_OR_RETURN_UNWRAP (&w, args.Holder ());
2042
2030
2043
2031
SSL_set_tlsext_status_type (w->ssl_ .get (), TLSEXT_STATUSTYPE_ocsp);
2044
- #endif // NODE__HAVE_TLSEXT_STATUS_CB
2045
2032
}
2046
2033
2047
2034
@@ -2226,7 +2213,6 @@ void SSLWrap<Base>::GetProtocol(const FunctionCallbackInfo<Value>& args) {
2226
2213
}
2227
2214
2228
2215
2229
- #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
2230
2216
template <class Base >
2231
2217
int SSLWrap<Base>::SelectALPNCallback(SSL* s,
2232
2218
const unsigned char ** out,
@@ -2256,13 +2242,11 @@ int SSLWrap<Base>::SelectALPNCallback(SSL* s,
2256
2242
return status == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK
2257
2243
: SSL_TLSEXT_ERR_NOACK;
2258
2244
}
2259
- #endif // TLSEXT_TYPE_application_layer_protocol_negotiation
2260
2245
2261
2246
2262
2247
template <class Base >
2263
2248
void SSLWrap<Base>::GetALPNNegotiatedProto(
2264
2249
const FunctionCallbackInfo<Value>& args) {
2265
- #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
2266
2250
Base* w;
2267
2251
ASSIGN_OR_RETURN_UNWRAP (&w, args.Holder ());
2268
2252
@@ -2276,13 +2260,11 @@ void SSLWrap<Base>::GetALPNNegotiatedProto(
2276
2260
2277
2261
args.GetReturnValue ().Set (
2278
2262
OneByteString (args.GetIsolate (), alpn_proto, alpn_proto_len));
2279
- #endif // TLSEXT_TYPE_application_layer_protocol_negotiation
2280
2263
}
2281
2264
2282
2265
2283
2266
template <class Base >
2284
2267
void SSLWrap<Base>::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) {
2285
- #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
2286
2268
Base* w;
2287
2269
ASSIGN_OR_RETURN_UNWRAP (&w, args.Holder ());
2288
2270
Environment* env = w->env ();
@@ -2306,11 +2288,9 @@ void SSLWrap<Base>::SetALPNProtocols(const FunctionCallbackInfo<Value>& args) {
2306
2288
SelectALPNCallback,
2307
2289
nullptr );
2308
2290
}
2309
- #endif // TLSEXT_TYPE_application_layer_protocol_negotiation
2310
2291
}
2311
2292
2312
2293
2313
- #ifdef NODE__HAVE_TLSEXT_STATUS_CB
2314
2294
template <class Base >
2315
2295
int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void * arg) {
2316
2296
Base* w = static_cast <Base*>(SSL_get_app_data (s));
@@ -2354,7 +2334,6 @@ int SSLWrap<Base>::TLSExtStatusCallback(SSL* s, void* arg) {
2354
2334
return SSL_TLSEXT_ERR_OK;
2355
2335
}
2356
2336
}
2357
- #endif // NODE__HAVE_TLSEXT_STATUS_CB
2358
2337
2359
2338
2360
2339
template <class Base >
@@ -2396,11 +2375,7 @@ int SSLWrap<Base>::SSLCertCallback(SSL* s, void* arg) {
2396
2375
info->Set (context, env->servername_string (), str).FromJust ();
2397
2376
}
2398
2377
2399
- 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);
2404
2379
info->Set (context, env->ocsp_request_string (),
2405
2380
Boolean::New (env->isolate (), ocsp)).FromJust ();
2406
2381
0 commit comments