Skip to content

Commit e896c6b

Browse files
aglMyles Borins
authored and
Myles Borins
committed
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 9c3302b commit e896c6b

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);
@@ -2119,7 +2123,12 @@ int SSLWrap<Base>::SSLCertCallback(SSL* s, void* arg) {
21192123
info->Set(env->tls_ticket_string(),
21202124
Boolean::New(env->isolate(), sess->tlsext_ticklen != 0));
21212125
}
2122-
bool ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp;
2126+
2127+
bool ocsp = false;
2128+
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
2129+
ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp;
2130+
#endif
2131+
21232132
info->Set(env->ocsp_request_string(), Boolean::New(env->isolate(), ocsp));
21242133

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

0 commit comments

Comments
 (0)