From f2a6f83862be3e20260b708288a8f7d0928e9018 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 20 Feb 2021 23:39:30 +0100 Subject: [PATCH] Cleanup : directly include of `internal/nelem.h` when required. And so clean a few useless includes Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19721) --- apps/s_client.c | 1 + crypto/ec/ec_backend.c | 1 + engines/e_devcrypto.c | 1 + include/internal/e_os.h | 1 - providers/baseprov.c | 1 - providers/common/provider_util.c | 1 - providers/fips/fipsprov.c | 1 + providers/implementations/encode_decode/decode_der2key.c | 1 + providers/implementations/kdfs/x942kdf.c | 1 + providers/implementations/kem/rsa_kem.c | 1 + providers/implementations/rands/seeding/rand_unix.c | 1 + providers/implementations/rands/seeding/rand_vms.c | 1 + ssl/ssl_lib.c | 1 + ssl/t1_trce.c | 1 + test/mdc2test.c | 1 - test/pkcs12_format_test.c | 2 -- test/testutil/format_output.c | 1 - test/testutil/tests.c | 1 - test/x509aux.c | 1 - 19 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/s_client.c b/apps/s_client.c index 0b8805a652..5324f50fcc 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -15,6 +15,7 @@ #include #include #include +#include "internal/nelem.h" #ifndef OPENSSL_NO_SOCK diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c index 60e88de488..b9ebc96465 100644 --- a/crypto/ec/ec_backend.c +++ b/crypto/ec/ec_backend.c @@ -25,6 +25,7 @@ #include "crypto/ec.h" #include "ec_local.h" #include "internal/e_os.h" +#include "internal/nelem.h" #include "internal/param_build_set.h" /* Mapping between a flag and a name */ diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c index 53aceefdb7..49ebe00b63 100644 --- a/engines/e_devcrypto.c +++ b/engines/e_devcrypto.c @@ -25,6 +25,7 @@ #include #include #include "crypto/cryptodev.h" +#include "internal/nelem.h" /* #define ENGINE_DEVCRYPTO_DEBUG */ diff --git a/include/internal/e_os.h b/include/internal/e_os.h index 042b45b3f1..0455849559 100644 --- a/include/internal/e_os.h +++ b/include/internal/e_os.h @@ -15,7 +15,6 @@ # include # include -# include "internal/nelem.h" # include "internal/numbers.h" /* Ensure the definition of SIZE_MAX */ /* diff --git a/providers/baseprov.c b/providers/baseprov.c index 44c6e8b7e7..f2729b3307 100644 --- a/providers/baseprov.c +++ b/providers/baseprov.c @@ -19,7 +19,6 @@ #include "prov/providercommon.h" #include "prov/implementations.h" #include "prov/provider_util.h" -#include "internal/nelem.h" /* * Forward declarations to ensure that interface functions are correctly diff --git a/providers/common/provider_util.c b/providers/common/provider_util.c index 2d8cba2ac9..2473754d26 100644 --- a/providers/common/provider_util.c +++ b/providers/common/provider_util.c @@ -19,7 +19,6 @@ # include "crypto/evp.h" #endif #include "prov/provider_util.h" -#include "internal/nelem.h" void ossl_prov_cipher_reset(PROV_CIPHER *pc) { diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index 533d9d1598..767b079e22 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -21,6 +21,7 @@ #include "prov/providercommon.h" #include "prov/provider_util.h" #include "prov/seeding.h" +#include "internal/nelem.h" #include "self_test.h" #include "crypto/context.h" #include "internal/core.h" diff --git a/providers/implementations/encode_decode/decode_der2key.c b/providers/implementations/encode_decode/decode_der2key.c index d4d3731460..6ea8cc0550 100644 --- a/providers/implementations/encode_decode/decode_der2key.c +++ b/providers/implementations/encode_decode/decode_der2key.c @@ -35,6 +35,7 @@ #include "prov/bio.h" #include "prov/implementations.h" #include "endecoder_local.h" +#include "internal/nelem.h" struct der2key_ctx_st; /* Forward declaration */ typedef int check_key_fn(void *, struct der2key_ctx_st *ctx); diff --git a/providers/implementations/kdfs/x942kdf.c b/providers/implementations/kdfs/x942kdf.c index 5e5bf68d60..78bd8d235e 100644 --- a/providers/implementations/kdfs/x942kdf.c +++ b/providers/implementations/kdfs/x942kdf.c @@ -17,6 +17,7 @@ #include #include "internal/packet.h" #include "internal/der.h" +#include "internal/nelem.h" #include "prov/provider_ctx.h" #include "prov/providercommon.h" #include "prov/implementations.h" diff --git a/providers/implementations/kem/rsa_kem.c b/providers/implementations/kem/rsa_kem.c index 882cf16125..365ae3d7d6 100644 --- a/providers/implementations/kem/rsa_kem.c +++ b/providers/implementations/kem/rsa_kem.c @@ -23,6 +23,7 @@ #include #include "crypto/rsa.h" #include +#include "internal/nelem.h" #include "prov/provider_ctx.h" #include "prov/implementations.h" #include "prov/securitycheck.h" diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c index 363f3b814e..fa7ad6cfeb 100644 --- a/providers/implementations/rands/seeding/rand_unix.c +++ b/providers/implementations/rands/seeding/rand_unix.c @@ -18,6 +18,7 @@ #include "crypto/rand_pool.h" #include "crypto/rand.h" #include "internal/dso.h" +#include "internal/nelem.h" #include "prov/seeding.h" #ifdef __linux diff --git a/providers/implementations/rands/seeding/rand_vms.c b/providers/implementations/rands/seeding/rand_vms.c index 07814a43dc..4ff879491a 100644 --- a/providers/implementations/rands/seeding/rand_vms.c +++ b/providers/implementations/rands/seeding/rand_vms.c @@ -12,6 +12,7 @@ #define __NEW_STARLET 1 /* New starlet definitions since VMS 7.0 */ #include #include "internal/cryptlib.h" +#include "internal/nelem.h" #include #include "crypto/rand.h" #include "crypto/rand_pool.h" diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index f8b8378ee9..118c4d95ba 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -23,6 +23,7 @@ #include #include #include "internal/cryptlib.h" +#include "internal/nelem.h" #include "internal/refcount.h" #include "internal/ktls.h" diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c index fbaa199fd5..a9b132d93b 100644 --- a/ssl/t1_trce.c +++ b/ssl/t1_trce.c @@ -12,6 +12,7 @@ #ifndef OPENSSL_NO_SSL_TRACE /* Packet trace support for OpenSSL */ +#include "internal/nelem.h" typedef struct { int num; diff --git a/test/mdc2test.c b/test/mdc2test.c index 9149e3e8ff..a524ceca16 100644 --- a/test/mdc2test.c +++ b/test/mdc2test.c @@ -18,7 +18,6 @@ #include #include #include -#include "internal/nelem.h" #include "testutil.h" #if defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_MDC2) diff --git a/test/pkcs12_format_test.c b/test/pkcs12_format_test.c index 0750f57e2f..507a9baf07 100644 --- a/test/pkcs12_format_test.c +++ b/test/pkcs12_format_test.c @@ -11,8 +11,6 @@ #include #include -#include "internal/nelem.h" - #include #include #include diff --git a/test/testutil/format_output.c b/test/testutil/format_output.c index e101a7ecef..8e84e1a6b6 100644 --- a/test/testutil/format_output.c +++ b/test/testutil/format_output.c @@ -13,7 +13,6 @@ #include #include -#include "internal/nelem.h" /* The size of memory buffers to display on failure */ #define MEM_BUFFER_SIZE (2000) diff --git a/test/testutil/tests.c b/test/testutil/tests.c index fbc2a0958e..50d4e12e05 100644 --- a/test/testutil/tests.c +++ b/test/testutil/tests.c @@ -14,7 +14,6 @@ #include #include #include -#include "internal/nelem.h" #include /* diff --git a/test/x509aux.c b/test/x509aux.c index bb3523dde5..7335e04771 100644 --- a/test/x509aux.c +++ b/test/x509aux.c @@ -16,7 +16,6 @@ #include #include #include -#include "internal/nelem.h" #include "testutil.h" static int test_certs(int num)