diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 8f504cd0a..6bc5c6aa2 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -26,20 +26,44 @@ #include #include -#include +#ifdef HAVE_CRL + #include +#endif #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef NO_DES3 + #include +#endif +#ifndef NO_HC128 + #include +#endif +#ifndef NO_RABBIT + #include +#endif +#ifdef HAVE_CHACHA + #include +#endif +#ifndef NO_ASN + #include +#endif +#ifndef NO_MD5 + #include +#endif +#ifndef NO_SHA + #include +#endif +#ifndef NO_AES + #include +#endif +#ifdef HAVE_POLY1305 + #include +#endif +#ifdef HAVE_CAMELLIA + #include +#endif #include -#include +#ifndef NO_HMAC + #include +#endif #ifndef NO_RC4 #include #endif @@ -69,7 +93,7 @@ #include #endif -#ifdef USE_WINDOWS_API +#ifdef USE_WINDOWS_API #ifdef WOLFSSL_GAME_BUILD #include "system/xtl.h" #else @@ -144,7 +168,7 @@ #endif -#ifdef USE_WINDOWS_API +#ifdef USE_WINDOWS_API typedef unsigned int SOCKET_T; #else typedef int SOCKET_T; diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 4fe649680..cf89bf32b 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -25,17 +25,27 @@ #define WOLF_CRYPT_ASN_H #include -#include +#ifndef NO_RSA + #include +#endif /* fips declare of RsaPrivateKeyDecode @wc_fips */ -#ifdef HAVE_FIPS +#if defined(HAVE_FIPS) && !defined(NO_RSA) #include #endif -#include -#include -#include -#include +#ifndef NO_DH + #include +#endif +#ifndef NO_DSA + #include +#endif +#ifndef NO_SHA + #include +#endif +#ifndef NO_MD5 + #include +#endif #include /* public interface */ #ifdef HAVE_ECC #include diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index 98b3081d4..8708708c7 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -24,8 +24,10 @@ #define WOLF_CRYPT_ASN_PUBLIC_H #include -#include -#ifdef WOLFSSL_CERT_GEN +#ifdef HAVE_ECC + #include +#endif +#if defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA) #include #endif diff --git a/wolfssl/wolfcrypt/chacha.h b/wolfssl/wolfcrypt/chacha.h index 9caa79cf8..5e2a51e08 100644 --- a/wolfssl/wolfcrypt/chacha.h +++ b/wolfssl/wolfcrypt/chacha.h @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifdef HAVE_CHACHA + #ifndef WOLF_CRYPT_CHACHA_H #define WOLF_CRYPT_CHACHA_H @@ -51,5 +53,6 @@ WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz); } /* extern "C" */ #endif -#endif +#endif /* WOLF_CRYPT_CHACHA_H */ +#endif /* HAVE_CHACHA */ diff --git a/wolfssl/wolfcrypt/pkcs7.h b/wolfssl/wolfcrypt/pkcs7.h index 1dc60712b..6cd346728 100644 --- a/wolfssl/wolfcrypt/pkcs7.h +++ b/wolfssl/wolfcrypt/pkcs7.h @@ -26,10 +26,14 @@ #define WOLF_CRYPT_PKCS7_H #include -#include +#ifndef NO_ASN + #include +#endif #include #include -#include +#ifndef NO_DES3 + #include +#endif #ifdef __cplusplus extern "C" {