Browse Source

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 <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
v5.x
Adam Langley 9 years ago
committed by Rod Vagg
parent
commit
abb0f6cd53
  1. 11
      src/node_crypto.cc

11
src/node_crypto.cc

@ -156,7 +156,11 @@ template int SSLWrap<TLSWrap>::SelectNextProtoCallback(
unsigned int inlen,
void* arg);
#endif
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
template int SSLWrap<TLSWrap>::TLSExtStatusCallback(SSL* s, void* arg);
#endif
template void SSLWrap<TLSWrap>::DestroySSL();
template int SSLWrap<TLSWrap>::SSLCertCallback(SSL* s, void* arg);
template void SSLWrap<TLSWrap>::WaitForCertCb(CertCb cb, void* arg);
@ -2263,7 +2267,12 @@ int SSLWrap<Base>::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<Value> argv[] = { info };

Loading…
Cancel
Save