SSL: fix build with OPENSSL_NO_ENGINE and/or OPENSSL_NO_OCSP.

This is really just a prerequisite for building against BoringSSL,
which doesn't provide either of those features.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
This commit is contained in:
Piotr Sikora 2014-07-28 12:27:57 -07:00
parent 5958181b1e
commit a57394b3e9
3 changed files with 15 additions and 1 deletions

View File

@ -3279,6 +3279,8 @@ ngx_openssl_create_conf(ngx_cycle_t *cycle)
static char * static char *
ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{ {
#ifndef OPENSSL_NO_ENGINE
ngx_openssl_conf_t *oscf = conf; ngx_openssl_conf_t *oscf = conf;
ENGINE *engine; ENGINE *engine;
@ -3313,6 +3315,12 @@ ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ENGINE_free(engine); ENGINE_free(engine);
return NGX_CONF_OK; return NGX_CONF_OK;
#else
return "is not supported";
#endif
} }
@ -3320,5 +3328,7 @@ static void
ngx_openssl_exit(ngx_cycle_t *cycle) ngx_openssl_exit(ngx_cycle_t *cycle)
{ {
EVP_cleanup(); EVP_cleanup();
#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup(); ENGINE_cleanup();
#endif
} }

View File

@ -18,9 +18,13 @@
#include <openssl/conf.h> #include <openssl/conf.h>
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/dh.h> #include <openssl/dh.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h> #include <openssl/engine.h>
#endif
#include <openssl/evp.h> #include <openssl/evp.h>
#ifndef OPENSSL_NO_OCSP
#include <openssl/ocsp.h> #include <openssl/ocsp.h>
#endif
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include <openssl/x509.h> #include <openssl/x509.h>

View File

@ -11,7 +11,7 @@
#include <ngx_event_connect.h> #include <ngx_event_connect.h>
#ifdef SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB #if (!defined OPENSSL_NO_OCSP && defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB)
typedef struct { typedef struct {