diff --git a/src/mod_openssl.c b/src/mod_openssl.c index 3f16ac84..d3267f94 100644 --- a/src/mod_openssl.c +++ b/src/mod_openssl.c @@ -49,8 +49,6 @@ #endif #endif -#include "sys-crypto.h" - #ifdef BORINGSSL_API_VERSION #undef OPENSSL_NO_STDIO /* for X509_STORE_load_locations() */ #endif diff --git a/src/mod_wolfssl.c b/src/mod_wolfssl.c index 2311c93a..a22b0ebe 100644 --- a/src/mod_wolfssl.c +++ b/src/mod_wolfssl.c @@ -41,7 +41,18 @@ * (wolfSSL provides an OpenSSL compatibility layer) */ -#include "sys-crypto.h" +/* wolfSSL needs to be built with ./configure --enable-lighty for lighttpd. + * Doing so defines OPENSSL_EXTRA and HAVE_LIGHTY in , and + * these defines are necessary for wolfSSL headers to expose sufficient openssl + * compatibility layer for wolfSSL to be able to provide an openssl substitute + * for use by lighttpd */ + +/* workaround fragile code in wolfssl/wolfcrypto/types.h */ +#if !defined(SIZEOF_LONG) || !defined(SIZEOF_LONG_LONG) +#undef SIZEOF_LONG +#undef SIZEOF_LONG_LONG +#endif + #include #include diff --git a/src/sys-crypto-md.h b/src/sys-crypto-md.h index 34960cc3..80bc7aef 100644 --- a/src/sys-crypto-md.h +++ b/src/sys-crypto-md.h @@ -227,7 +227,7 @@ SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length) } #endif -#elif defined(USE_WOLFSSL_CRYPTO) && !defined(USE_OPENSSL_CRYPTO) +#elif defined(USE_WOLFSSL_CRYPTO) /* WolfSSL compatibility API for OpenSSL unnecessarily bounces through an extra * layer of indirection. However, to avoid conflicting typedefs when includers @@ -236,6 +236,12 @@ SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length) * (undef of OPENSSL_EXTRA and NO_OLD_WC_NAMES not sufficient, and not friendly * to do in a header when others might rely on them) */ +/* workaround fragile code in wolfssl/wolfcrypto/types.h */ +#if !defined(SIZEOF_LONG) || !defined(SIZEOF_LONG_LONG) +#undef SIZEOF_LONG +#undef SIZEOF_LONG_LONG +#endif + #ifndef NO_MD4 #include #include diff --git a/src/sys-crypto.h b/src/sys-crypto.h index 8fda44d0..a84047b4 100644 --- a/src/sys-crypto.h +++ b/src/sys-crypto.h @@ -7,34 +7,9 @@ #define USE_OPENSSL_CRYPTO #endif -#ifndef USE_OPENSSL_CRYPTO #ifdef HAVE_WOLFSSL_SSL_H #define USE_LIB_CRYPTO #define USE_WOLFSSL_CRYPTO -/* wolfSSL needs to be built with ./configure --enable-lighty for lighttpd. - * Doing so defines OPENSSL_EXTRA and HAVE_LIGHTY in , and - * these defines are necessary for wolfSSL headers to expose sufficient openssl - * compatibility layer for wolfSSL to be able to provide an openssl substitute - * for use by lighttpd */ -#include - -/* workaround fragile code in wolfssl/wolfcrypto/types.h */ -#ifdef __SIZEOF_LONG__ -#ifndef SIZEOF_LONG -#define SIZEOF_LONG __SIZEOF_LONG__ -#endif -#endif -#ifdef __SIZEOF_LONG_LONG__ -#ifndef SIZEOF_LONG_LONG -#define SIZEOF_LONG_LONG __SIZEOF_LONG_LONG__ -#endif -#endif -#if !defined(SIZEOF_LONG) || !defined(SIZEOF_LONG_LONG) -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#endif - -#endif #endif #ifdef HAVE_LIBMBEDCRYPTO