diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 355feff1a..be093a49b 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -57,6 +57,7 @@ #include #include +#include #include #include diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index f0badcca9..e02e85866 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -57,6 +57,7 @@ #include #include +#include #include #include diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 930437776..52b010ffb 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -57,6 +57,7 @@ #include #include +#include #include #include diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c index f6045e402..1b9de942d 100644 --- a/crypto/asn1/tasn_utl.c +++ b/crypto/asn1/tasn_utl.c @@ -62,6 +62,7 @@ #include #include #include +#include /* Utility functions for manipulating fields and offsets */ diff --git a/crypto/bio/bio.c b/crypto/bio/bio.c index 86fb8536d..4a0776230 100644 --- a/crypto/bio/bio.c +++ b/crypto/bio/bio.c @@ -58,7 +58,6 @@ #include #include -#include #include #include diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc index b56f6416f..4c88df572 100644 --- a/crypto/bio/bio_test.cc +++ b/crypto/bio/bio_test.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include diff --git a/crypto/cipher/aead_test.c b/crypto/cipher/aead_test.c index 2bdff03f8..84fb338b3 100644 --- a/crypto/cipher/aead_test.c +++ b/crypto/cipher/aead_test.c @@ -13,8 +13,6 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include -#include -#include #include #include diff --git a/crypto/cipher/cipher_test.c b/crypto/cipher/cipher_test.c index 72bbb61a9..cdfecdc9d 100644 --- a/crypto/cipher/cipher_test.c +++ b/crypto/cipher/cipher_test.c @@ -54,7 +54,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#include +#include #include #include diff --git a/crypto/cipher/internal.h b/crypto/cipher/internal.h index e70d9cee9..e6220d411 100644 --- a/crypto/cipher/internal.h +++ b/crypto/cipher/internal.h @@ -60,7 +60,6 @@ #include #include -#include #if defined(__cplusplus) extern "C" { diff --git a/crypto/cpu-intel.c b/crypto/cpu-intel.c index 69f4570d4..df0e127b1 100644 --- a/crypto/cpu-intel.c +++ b/crypto/cpu-intel.c @@ -64,6 +64,7 @@ #if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) #include +#include #include #include diff --git a/crypto/des/des.c b/crypto/des/des.c index d1ddb7a3a..56a299675 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -56,6 +56,8 @@ #include +#include + #include "internal.h" diff --git a/crypto/dh/dh_impl.c b/crypto/dh/dh_impl.c index 9f416b7ce..5c4d63720 100644 --- a/crypto/dh/dh_impl.c +++ b/crypto/dh/dh_impl.c @@ -58,6 +58,7 @@ #include #include +#include #include "internal.h" diff --git a/crypto/digest/md32_common.h b/crypto/digest/md32_common.h index a4ce3558c..51508a6d3 100644 --- a/crypto/digest/md32_common.h +++ b/crypto/digest/md32_common.h @@ -51,8 +51,6 @@ #include -#include - #if defined(__cplusplus) extern "C" { diff --git a/crypto/directory_posix.c b/crypto/directory_posix.c index c16701dab..b944b6920 100644 --- a/crypto/directory_posix.c +++ b/crypto/directory_posix.c @@ -35,6 +35,7 @@ #include #include +#include #include #if defined(OPENSSL_PNACL) diff --git a/crypto/directory_win.c b/crypto/directory_win.c index 2e4600f53..4ebacf216 100644 --- a/crypto/directory_win.c +++ b/crypto/directory_win.c @@ -41,6 +41,9 @@ #define NAME_MAX 255 #endif +#include + + struct OPENSSL_dir_context_st { WIN32_FIND_DATA ctx; HANDLE handle; diff --git a/crypto/dsa/dsa.c b/crypto/dsa/dsa.c index eca073a3d..5303714c9 100644 --- a/crypto/dsa/dsa.c +++ b/crypto/dsa/dsa.c @@ -67,6 +67,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/dsa/dsa_impl.c b/crypto/dsa/dsa_impl.c index 9efd008b9..aba7f8542 100644 --- a/crypto/dsa/dsa_impl.c +++ b/crypto/dsa/dsa_impl.c @@ -66,6 +66,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 050d77f44..b4671ed54 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -74,6 +74,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/ec/ec_test.c b/crypto/ec/ec_test.c index cffd3323c..269005bc5 100644 --- a/crypto/ec/ec_test.c +++ b/crypto/ec/ec_test.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/ec/wnaf.c b/crypto/ec/wnaf.c index e36efe206..b6d1a5419 100644 --- a/crypto/ec/wnaf.c +++ b/crypto/ec/wnaf.c @@ -72,6 +72,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/ecdsa/ecdsa.c b/crypto/ecdsa/ecdsa.c index ab6a5a0f9..b8030cb32 100644 --- a/crypto/ecdsa/ecdsa.c +++ b/crypto/ecdsa/ecdsa.c @@ -57,7 +57,6 @@ #include #include #include -#include #include "../ec/internal.h" diff --git a/crypto/err/err.c b/crypto/err/err.c index 680663b28..936ee507e 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -111,8 +111,6 @@ #include #include #include -#include -#include #include #if defined(OPENSSL_WINDOWS) @@ -121,7 +119,6 @@ #pragma warning(pop) #endif -#include #include #include diff --git a/crypto/evp/evp.c b/crypto/evp/evp.c index 64ffed6d5..5716ced26 100644 --- a/crypto/evp/evp.c +++ b/crypto/evp/evp.c @@ -67,6 +67,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 0c2503ef7..d399b83d6 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -108,7 +108,11 @@ #include +#include +#include + #include +#include #include #include "crypto_error.h" diff --git a/crypto/md4/md4.c b/crypto/md4/md4.c index 8fb357b59..6150b969a 100644 --- a/crypto/md4/md4.c +++ b/crypto/md4/md4.c @@ -56,6 +56,7 @@ #include +#include #include diff --git a/crypto/modes/internal.h b/crypto/modes/internal.h index 9662e0ddc..d12405e6a 100644 --- a/crypto/modes/internal.h +++ b/crypto/modes/internal.h @@ -121,6 +121,9 @@ extern "C" { #endif #elif defined(_MSC_VER) #if _MSC_VER >= 1300 +#pragma warning(push, 3) +#include +#pragma warning(pop) #pragma intrinsic(_byteswap_uint64, _byteswap_ulong) #define BSWAP8(x) _byteswap_uint64((uint64_t)(x)) #define BSWAP4(x) _byteswap_ulong((uint32_t)(x)) diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c index 18cfb9271..383a52404 100644 --- a/crypto/pem/pem_pk8.c +++ b/crypto/pem/pem_pk8.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include diff --git a/crypto/pkcs8/pkcs12_test.c b/crypto/pkcs8/pkcs12_test.c index e40178636..11a30903d 100644 --- a/crypto/pkcs8/pkcs12_test.c +++ b/crypto/pkcs8/pkcs12_test.c @@ -13,7 +13,6 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include -#include #include #include diff --git a/crypto/rand/urandom.c b/crypto/rand/urandom.c index a8749749d..05043fe4d 100644 --- a/crypto/rand/urandom.c +++ b/crypto/rand/urandom.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/crypto/rsa/blinding.c b/crypto/rsa/blinding.c index 16c34bb60..c5a1604bc 100644 --- a/crypto/rsa/blinding.c +++ b/crypto/rsa/blinding.c @@ -113,6 +113,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/rsa/internal.h b/crypto/rsa/internal.h index 2763253ab..d15f2a5fd 100644 --- a/crypto/rsa/internal.h +++ b/crypto/rsa/internal.h @@ -60,7 +60,7 @@ #include #include -#include + #if defined(__cplusplus) extern "C" { diff --git a/crypto/rsa/rsa.c b/crypto/rsa/rsa.c index 2de2add94..884f67e4b 100644 --- a/crypto/rsa/rsa.c +++ b/crypto/rsa/rsa.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/rsa/rsa_impl.c b/crypto/rsa/rsa_impl.c index 064513bf5..f790e6411 100644 --- a/crypto/rsa/rsa_impl.c +++ b/crypto/rsa/rsa_impl.c @@ -61,6 +61,7 @@ #include #include #include +#include #include "internal.h" diff --git a/crypto/rsa/rsa_test.c b/crypto/rsa/rsa_test.c index 640ffb838..10a6e1daa 100644 --- a/crypto/rsa/rsa_test.c +++ b/crypto/rsa/rsa_test.c @@ -56,6 +56,7 @@ #include +#include #include #include diff --git a/crypto/thread.c b/crypto/thread.c index 48d5bbc34..abc8b6f99 100644 --- a/crypto/thread.c +++ b/crypto/thread.c @@ -56,10 +56,11 @@ #include -#include #include -#if defined(OPENSSL_WINDOWS) +#if !defined(OPENSSL_WINDOWS) +#include +#else #pragma warning(push, 3) #include #pragma warning(pop) diff --git a/crypto/time_support.c b/crypto/time_support.c index 9aa64ce5f..bf9daed1a 100644 --- a/crypto/time_support.c +++ b/crypto/time_support.c @@ -67,6 +67,9 @@ #include +#include + + #define SECS_PER_DAY (24 * 60 * 60) struct tm *OPENSSL_gmtime(const time_t *time, struct tm *result) { diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 3573c86f9..098c1bd95 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -63,6 +63,7 @@ #include #include #include +#include #include diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c index 264963180..2fdbce4a6 100644 --- a/crypto/x509/by_file.c +++ b/crypto/x509/by_file.c @@ -55,11 +55,14 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ +#include + #include #include #include #include -#include +#include + #ifndef OPENSSL_NO_STDIO diff --git a/crypto/x509/pkcs7.c b/crypto/x509/pkcs7.c index bb8607766..99ee3daa6 100644 --- a/crypto/x509/pkcs7.c +++ b/crypto/x509/pkcs7.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/crypto/x509/pkcs7_test.c b/crypto/x509/pkcs7_test.c index bac9fb285..38beb3e8e 100644 --- a/crypto/x509/pkcs7_test.c +++ b/crypto/x509/pkcs7_test.c @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index 090d341cb..cfac81d22 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index e556fa46b..dae33762e 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c index bb23b57ea..aa92fa987 100644 --- a/crypto/x509/x_crl.c +++ b/crypto/x509/x_crl.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include diff --git a/crypto/x509/x_info.c b/crypto/x509/x_info.c index 8047c7192..6807b2419 100644 --- a/crypto/x509/x_info.c +++ b/crypto/x509/x_info.c @@ -59,6 +59,7 @@ #include #include #include +#include X509_INFO *X509_INFO_new(void) diff --git a/crypto/x509/x_pkey.c b/crypto/x509/x_pkey.c index 550078bea..5acbe5b47 100644 --- a/crypto/x509/x_pkey.c +++ b/crypto/x509/x_pkey.c @@ -59,8 +59,9 @@ #include #include -#include #include +#include +#include X509_PKEY *X509_PKEY_new(void) diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c index c285aa677..4b96ed75f 100644 --- a/crypto/x509/x_pubkey.c +++ b/crypto/x509/x_pubkey.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include "../evp/internal.h" diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c index 5826c7bbf..3f175c959 100644 --- a/crypto/x509v3/v3_purp.c +++ b/crypto/x509v3/v3_purp.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include diff --git a/crypto/x509v3/v3nametest.c b/crypto/x509v3/v3nametest.c index b6d36325a..a3197e608 100644 --- a/crypto/x509v3/v3nametest.c +++ b/crypto/x509v3/v3nametest.c @@ -52,6 +52,7 @@ * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). */ +#include #include #include diff --git a/decrepit/cast/cast.c b/decrepit/cast/cast.c index bd2c0e983..68bcbe320 100644 --- a/decrepit/cast/cast.c +++ b/decrepit/cast/cast.c @@ -56,6 +56,12 @@ #include +#if defined(OPENSSL_WINDOWS) +#pragma warning(push, 3) +#include +#pragma warning(pop) +#endif + #include "../macros.h" diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 4baf81c6b..7c62161e3 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -61,8 +61,6 @@ #include -#include - #include #include diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index 72eb2cbc6..6c91134d5 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -58,7 +58,7 @@ #ifndef HEADER_ASN1T_H #define HEADER_ASN1T_H -#include +#include #include #ifdef OPENSSL_BUILD_SHLIBCRYPTO diff --git a/include/openssl/base.h b/include/openssl/base.h index 217908c93..77549f78f 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -56,8 +56,8 @@ /* This file should be the first included by all BoringSSL headers. */ +#include #include -#include #include #include @@ -175,6 +175,8 @@ typedef struct buf_mem_st BUF_MEM; typedef struct cbb_st CBB; typedef struct cbs_st CBS; typedef struct conf_st CONF; +typedef struct conf_value_st CONF_VALUE; +typedef int CRYPTO_THREADID; typedef struct dh_method DH_METHOD; typedef struct dh_st DH; typedef struct dsa_method DSA_METHOD; diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 0a637e457..6ce25bb7b 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -59,7 +59,6 @@ #include -#include #include /* For FILE */ #include /* for ERR_print_errors_fp */ diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 05bad9b4e..84fc94f99 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -79,11 +79,11 @@ extern "C" { * * Config files are representated by a |CONF|. */ -typedef struct { +struct conf_value_st { char *section; char *name; char *value; -} CONF_VALUE; +}; struct conf_st { LHASH_OF(CONF_VALUE) *data; diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 44793f46a..1dc834643 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -17,7 +17,6 @@ #include -#include #if defined(__cplusplus) extern "C" { diff --git a/include/openssl/err.h b/include/openssl/err.h index 738e8c5db..552ea92ca 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -112,8 +112,6 @@ #include #include -#include -#include #if defined(__cplusplus) extern "C" { diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 24fd038dc..ded7a584b 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -58,7 +58,6 @@ #define OPENSSL_HEADER_EVP_H #include -#include /* OpenSSL included digest and cipher functions in this header so we include * them for users that still expect that. @@ -67,9 +66,7 @@ #include #include #include -#include #include -#include #if defined(__cplusplus) extern "C" { diff --git a/include/openssl/mem.h b/include/openssl/mem.h index 3bd01c063..42ec46a07 100644 --- a/include/openssl/mem.h +++ b/include/openssl/mem.h @@ -58,6 +58,7 @@ #include +#include #include #if defined(__cplusplus) diff --git a/include/openssl/pkcs8.h b/include/openssl/pkcs8.h index e0d7b107e..8dc7731bf 100644 --- a/include/openssl/pkcs8.h +++ b/include/openssl/pkcs8.h @@ -58,11 +58,9 @@ #define OPENSSL_HEADER_PKCS8_H #include - -#include - #include + #if defined(__cplusplus) extern "C" { #endif diff --git a/include/openssl/time_support.h b/include/openssl/time_support.h index d03a99d0c..912e67241 100644 --- a/include/openssl/time_support.h +++ b/include/openssl/time_support.h @@ -60,7 +60,6 @@ #include -#include #if defined(__cplusplus) extern "C" { diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index 712af4916..e4a7f0dc9 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -85,6 +85,7 @@ #include #include +#include #include #include "internal.h" diff --git a/tool/args.cc b/tool/args.cc index a1644767c..b7d704753 100644 --- a/tool/args.cc +++ b/tool/args.cc @@ -16,7 +16,6 @@ #include #include -#include #include "internal.h" @@ -30,7 +29,7 @@ bool ParseKeyValueArguments(std::map *out_args, const std::string &arg = args[i]; const struct argument *templ = nullptr; for (size_t j = 0; templates[j].name[0] != 0; j++) { - if (strcmp(arg.c_str(), templates[j].name) == 0) { + if (arg != std::string(templates[j].name)) { templ = &templates[j]; break; } diff --git a/tool/client.cc b/tool/client.cc index f2784786e..1de0df27e 100644 --- a/tool/client.cc +++ b/tool/client.cc @@ -14,13 +14,6 @@ #include -#include -#include - -#include -#include -#include - #include #include #include diff --git a/tool/const.cc b/tool/const.cc index 219fd3cf4..5222667ef 100644 --- a/tool/const.cc +++ b/tool/const.cc @@ -12,8 +12,8 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include -#include extern "C" { diff --git a/tool/digest.cc b/tool/digest.cc index 4acf97c8b..bed591c7b 100644 --- a/tool/digest.cc +++ b/tool/digest.cc @@ -21,12 +21,11 @@ #include #include #include -#include -#include #include #include #if !defined(OPENSSL_WINDOWS) +#include #include #if !defined(O_BINARY) #define O_BINARY 0 diff --git a/tool/server.cc b/tool/server.cc index 2890b098a..164d6a531 100644 --- a/tool/server.cc +++ b/tool/server.cc @@ -14,13 +14,6 @@ #include -#include -#include - -#include -#include -#include - #include #include diff --git a/tool/speed.cc b/tool/speed.cc index 3834a684e..f3698f5b7 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/tool/transport_common.cc b/tool/transport_common.cc index 8d6013b6a..ac4dfe1f3 100644 --- a/tool/transport_common.cc +++ b/tool/transport_common.cc @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include