* Hudson (tjh@cryptsoft.com).
*
*/
-#ifndef OPENSSL_NO_OCSP
+#include <openssl/opensslconf.h>
+
+#ifdef OPENSSL_NO_OCSP
+NON_EMPTY_TRANSLATION_UNIT
+#else
# ifdef OPENSSL_SYS_VMS
# define _XOPEN_SOURCE_EXTENDED/* So fd_set and friends get properly defined
* on OpenVMS */
# include <string.h>
# include <time.h>
# include <ctype.h>
-# include "apps.h" /* needs to be included before the openssl
- * headers! */
+
+/* Needs to be included before the openssl headers */
+# include "apps.h"
# include <openssl/e_os2.h>
# include <openssl/crypto.h>
# include <openssl/err.h>
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;
BIO_free_all(acbio);
BIO_free(bufbio);
return NULL;
+# endif
}
-
+# ifndef OPENSSL_NO_SOCK
/*
* Decode %xx URL-decoding in-place. Ignores mal-formed sequences.
*/
if (*p != '%')
*out++ = *p;
else if (isxdigit(_UC(p[1])) && isxdigit(_UC(p[2]))) {
- *out++ = (app_hex(p[1]) << 4) | app_hex(p[2]);
+ /* Don't check, can't fail because of ixdigit() call. */
+ *out++ = (OPENSSL_hexchar2int(p[1]) << 4)
+ | OPENSSL_hexchar2int(p[2]);
p += 2;
}
else
*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];
*preq = req;
return 1;
-
+# endif
}
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp)