Skip to content

Commit abb0f6c

Browse files
aglrvagg
authored andcommitted
crypto: fix build when OCSP-stapling not provided
node_crypto.cc attempts to handle the case where OCSP stapling APIs aren't provided by using NODE__HAVE_TLSEXT_STATUS_CB. But the build would actually fail in this case because of a couple of places that were missing #ifdefs. With this change the build works although, as expected, test-tls-ocsp-callback.js will fail. PR-URL: #4914 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shigeki Ohtsu <[email protected]>
1 parent e415eb2 commit abb0f6c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/node_crypto.cc

+10-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ template int SSLWrap<TLSWrap>::SelectNextProtoCallback(
156156
unsigned int inlen,
157157
void* arg);
158158
#endif
159+
160+
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
159161
template int SSLWrap<TLSWrap>::TLSExtStatusCallback(SSL* s, void* arg);
162+
#endif
163+
160164
template void SSLWrap<TLSWrap>::DestroySSL();
161165
template int SSLWrap<TLSWrap>::SSLCertCallback(SSL* s, void* arg);
162166
template void SSLWrap<TLSWrap>::WaitForCertCb(CertCb cb, void* arg);
@@ -2263,7 +2267,12 @@ int SSLWrap<Base>::SSLCertCallback(SSL* s, void* arg) {
22632267
info->Set(env->tls_ticket_string(),
22642268
Boolean::New(env->isolate(), sess->tlsext_ticklen != 0));
22652269
}
2266-
bool ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp;
2270+
2271+
bool ocsp = false;
2272+
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
2273+
ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp;
2274+
#endif
2275+
22672276
info->Set(env->ocsp_request_string(), Boolean::New(env->isolate(), ocsp));
22682277

22692278
Local<Value> argv[] = { info };

0 commit comments

Comments
 (0)