From 2665db73a43123c5b2a3211fbba0fd1dd41d6dbd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 28 Mar 2016 16:03:15 -0600 Subject: [PATCH] check for compiling misc.c when not needed --- src/internal.c | 1 + src/ocsp.c | 1 + src/sniffer.c | 1 + src/ssl.c | 1 + src/tls.c | 1 + wolfcrypt/src/aes.c | 1 + wolfcrypt/src/asn.c | 1 + wolfcrypt/src/camellia.c | 1 + wolfcrypt/src/chacha.c | 1 + wolfcrypt/src/chacha20_poly1305.c | 1 + wolfcrypt/src/compress.c | 1 + wolfcrypt/src/curve25519.c | 1 + wolfcrypt/src/des3.c | 1 + wolfcrypt/src/ecc.c | 1 + wolfcrypt/src/ed25519.c | 1 + wolfcrypt/src/fe_low_mem.c | 1 + wolfcrypt/src/fe_operations.c | 1 + wolfcrypt/src/ge_low_mem.c | 1 + wolfcrypt/src/ge_operations.c | 1 + wolfcrypt/src/hc128.c | 1 + wolfcrypt/src/idea.c | 1 + wolfcrypt/src/md2.c | 1 + wolfcrypt/src/md4.c | 1 + wolfcrypt/src/md5.c | 1 + wolfcrypt/src/misc.c | 5 +++++ wolfcrypt/src/pkcs7.c | 1 + wolfcrypt/src/poly1305.c | 1 + wolfcrypt/src/pwdbased.c | 1 + wolfcrypt/src/rabbit.c | 1 + wolfcrypt/src/random.c | 1 + wolfcrypt/src/ripemd.c | 1 + wolfcrypt/src/rsa.c | 1 + wolfcrypt/src/sha.c | 1 + wolfcrypt/src/sha256.c | 1 + wolfcrypt/src/sha512.c | 1 + wolfcrypt/src/srp.c | 1 + wolfcrypt/src/tfm.c | 1 + 37 files changed, 41 insertions(+) diff --git a/src/internal.c b/src/internal.c index 70bb27900..c9c0d2031 100644 --- a/src/internal.c +++ b/src/internal.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/ocsp.c b/src/ocsp.c index dfc65ff0c..16d560698 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/sniffer.c b/src/sniffer.c index 3561781f4..010ad61b9 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -50,6 +50,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/ssl.c b/src/ssl.c index 0ca464ffe..e5234b2f6 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/src/tls.c b/src/tls.c index 8294d2342..a655896a8 100644 --- a/src/tls.c +++ b/src/tls.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 1c57f405b..ad8cb5213 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -187,6 +187,7 @@ void wc_AesFreeCavium(Aes* aes) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #ifdef DEBUG_AESNI diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 0c41eaa34..d4eb4f8d4 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -54,6 +54,7 @@ ASN Options: #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/camellia.c b/wolfcrypt/src/camellia.c index 7607875d3..bb2cfe8c2 100644 --- a/wolfcrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -67,6 +67,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index a383689a7..eafc8e579 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -40,6 +40,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/chacha20_poly1305.c b/wolfcrypt/src/chacha20_poly1305.c index d0da3c5fe..3964b4ea8 100644 --- a/wolfcrypt/src/chacha20_poly1305.c +++ b/wolfcrypt/src/chacha20_poly1305.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else +#define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/compress.c b/wolfcrypt/src/compress.c index 0dd47a335..346dcbc7d 100644 --- a/wolfcrypt/src/compress.c +++ b/wolfcrypt/src/compress.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/curve25519.c b/wolfcrypt/src/curve25519.c index 6fb359a4b..1f7c012d9 100644 --- a/wolfcrypt/src/curve25519.c +++ b/wolfcrypt/src/curve25519.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 1bf3f3d2f..f39bb6842 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -127,6 +127,7 @@ void wc_Des3_FreeCavium(Des3* des3) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 4261e7854..807c44fe8 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -76,6 +76,7 @@ ECC Curves: #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index b776566eb..959225015 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/fe_low_mem.c b/wolfcrypt/src/fe_low_mem.c index 373fd1cc5..e7b793ca9 100644 --- a/wolfcrypt/src/fe_low_mem.c +++ b/wolfcrypt/src/fe_low_mem.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index 636ef70f0..7f7f388fe 100644 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ge_low_mem.c b/wolfcrypt/src/ge_low_mem.c index 4f809103b..9f17e5e1f 100644 --- a/wolfcrypt/src/ge_low_mem.c +++ b/wolfcrypt/src/ge_low_mem.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index fe9c7280b..a7970b51d 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -38,6 +38,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/hc128.c b/wolfcrypt/src/hc128.c index 54d832de0..4e365244d 100644 --- a/wolfcrypt/src/hc128.c +++ b/wolfcrypt/src/hc128.c @@ -35,6 +35,7 @@ #include #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/idea.c b/wolfcrypt/src/idea.c index 730ee4da1..5d7550a5f 100644 --- a/wolfcrypt/src/idea.c +++ b/wolfcrypt/src/idea.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md2.c b/wolfcrypt/src/md2.c index 094a1199c..02f3e4936 100644 --- a/wolfcrypt/src/md2.c +++ b/wolfcrypt/src/md2.c @@ -35,6 +35,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md4.c b/wolfcrypt/src/md4.c index 54fd4ebb1..126077f3c 100644 --- a/wolfcrypt/src/md4.c +++ b/wolfcrypt/src/md4.c @@ -32,6 +32,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 1143e86b0..0a6c3f617 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -45,6 +45,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index bc2cefd76..4a9de4fa0 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -39,11 +39,16 @@ */ #ifdef NO_INLINE + #undef WOLFSSL_MISC_COMPILED + #define WOLFSSL_MISC_COMPILED #define STATIC #else #define STATIC static #endif +#ifndef WOLFSSL_MISC_COMPILED + #error misc.c does not need to be compiled when not defined NO_INLINE +#endif #ifdef INTEL_INTRINSICS diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 721ec21f3..a8bce24f2 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -34,6 +34,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/poly1305.c b/wolfcrypt/src/poly1305.c index 8725fb01f..1e76c707c 100644 --- a/wolfcrypt/src/poly1305.c +++ b/wolfcrypt/src/poly1305.c @@ -37,6 +37,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #ifdef CHACHA_AEAD_TEST diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 5efd21fc8..7f3e50759 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -55,6 +55,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/rabbit.c b/wolfcrypt/src/rabbit.c index dc2c9b7b0..53a31b91e 100644 --- a/wolfcrypt/src/rabbit.c +++ b/wolfcrypt/src/rabbit.c @@ -34,6 +34,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 124e18281..65f900f0e 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -131,6 +131,7 @@ int wc_FreeRng(WC_RNG* rng) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif #endif /* HAVE_HASHDRBG || NO_RC4 */ diff --git a/wolfcrypt/src/ripemd.c b/wolfcrypt/src/ripemd.c index 1ec17d5cf..55a483162 100644 --- a/wolfcrypt/src/ripemd.c +++ b/wolfcrypt/src/ripemd.c @@ -33,6 +33,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 0232af6f2..630de3fa3 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -129,6 +129,7 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* a, word32* aSz, byte* b, #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index b0d8dd9dc..cd3e6f161 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -36,6 +36,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index ad862caa0..09c2d0c36 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -282,6 +282,7 @@ static void set_Transform(void) { #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 9b0649fa6..162a7ff8c 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -76,6 +76,7 @@ int wc_Sha384Final(Sha384* sha, byte* out) #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/srp.c b/wolfcrypt/src/srp.c index 415cad38e..05393e140 100644 --- a/wolfcrypt/src/srp.c +++ b/wolfcrypt/src/srp.c @@ -35,6 +35,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 4ee88bddc..00c6ec97b 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -40,6 +40,7 @@ #ifdef NO_INLINE #include #else + #define WOLFSSL_MISC_COMPILED #include #endif