diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-20 12:56:37 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-20 14:52:46 +0100 |
commit | f863ad0c59374ee8cc91dcae71ef60ceabc969f1 (patch) | |
tree | 51b28ea959d38ec7f49c7efd457e58a7c7c5f117 /apps/ocsp.c | |
parent | 2469e76b30d64d9374e06523f3c8a7d669986523 (diff) |
Fix no-sock on Windows
Link errors were occurring on Windows because the header files were not
correctly guarding some functions with OPENSSL_NO_SOCK
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r-- | apps/ocsp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c index ca293a9709..c1679f0292 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1027,13 +1027,13 @@ static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser) static BIO *init_responder(const char *port) { - BIO *acbio = NULL, *bufbio = NULL; - # ifdef OPENSSL_NO_SOCK BIO_printf(bio_err, "Error setting up accept BIO - sockets not supported.\n"); return NULL; -# endif +# else + BIO *acbio = NULL, *bufbio = NULL; + bufbio = BIO_new(BIO_f_buffer()); if (bufbio == NULL) goto err; @@ -1060,9 +1060,10 @@ static BIO *init_responder(const char *port) BIO_free_all(acbio); BIO_free(bufbio); return NULL; +# endif } - +# ifndef OPENSSL_NO_SOCK /* * Decode %xx URL-decoding in-place. Ignores mal-formed sequences. */ @@ -1086,9 +1087,13 @@ static int urldecode(char *p) *out = '\0'; return (int)(out - save); } +# endif static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio) { +# ifdef OPENSSL_NO_SOCK + return 0; +# else int len; OCSP_REQUEST *req = NULL; char inbuf[2048], reqbuf[2048]; @@ -1169,7 +1174,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio) *preq = req; return 1; - +# endif } static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp) |