From 4f12b8313b000e113870bdbc107df56fd99b63d1 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 27 Jan 2016 12:15:00 -0800 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/4914 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Shigeki Ohtsu --- src/node_crypto.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 053e6970c377cb..1956c6db318e0f 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -156,7 +156,11 @@ template int SSLWrap::SelectNextProtoCallback( unsigned int inlen, void* arg); #endif + +#ifdef NODE__HAVE_TLSEXT_STATUS_CB template int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg); +#endif + template void SSLWrap::DestroySSL(); template int SSLWrap::SSLCertCallback(SSL* s, void* arg); template void SSLWrap::WaitForCertCb(CertCb cb, void* arg); @@ -2119,7 +2123,12 @@ int SSLWrap::SSLCertCallback(SSL* s, void* arg) { info->Set(env->tls_ticket_string(), Boolean::New(env->isolate(), sess->tlsext_ticklen != 0)); } - bool ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp; + + bool ocsp = false; +#ifdef NODE__HAVE_TLSEXT_STATUS_CB + ocsp = s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp; +#endif + info->Set(env->ocsp_request_string(), Boolean::New(env->isolate(), ocsp)); Local argv[] = { info };