From: Dr. David von Oheimb Date: Wed, 26 Feb 2025 17:56:21 +0000 (+0100) Subject: crypto/{cmp,crmf}/: clean up unneeded #include directives X-Git-Tag: openssl-3.6.0-alpha1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef63a77758e769dd205069d881b0556e142e11b1;p=thirdparty%2Fopenssl.git crypto/{cmp,crmf}/: clean up unneeded #include directives Reviewed-by: Paul Dale Reviewed-by: Tom Cosgrove (Merged from https://github.com/openssl/openssl/pull/28035) --- diff --git a/crypto/cmp/cmp_asn.c b/crypto/cmp/cmp_asn.c index a3263202674..a2d3d3a8493 100644 --- a/crypto/cmp/cmp_asn.c +++ b/crypto/cmp/cmp_asn.c @@ -14,10 +14,6 @@ #include "cmp_local.h" #include "internal/crmf.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include - /* ASN.1 declarations from RFC4210 */ ASN1_SEQUENCE(OSSL_CMP_REVANNCONTENT) = { /* OSSL_CMP_PKISTATUS is effectively ASN1_INTEGER so it is used directly */ diff --git a/crypto/cmp/cmp_client.c b/crypto/cmp/cmp_client.c index e129705e0e6..2001414241c 100644 --- a/crypto/cmp/cmp_client.c +++ b/crypto/cmp/cmp_client.c @@ -10,15 +10,6 @@ */ #include "cmp_local.h" -#include "internal/cryptlib.h" - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include -#include #define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \ || (t) == OSSL_CMP_PKIBODY_KUP) diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c index 7b78ab16036..c6196987272 100644 --- a/crypto/cmp/cmp_ctx.c +++ b/crypto/cmp/cmp_ctx.c @@ -9,16 +9,8 @@ * https://www.openssl.org/source/license.html */ -#include -#include -#include /* for OCSP_REVOKED_STATUS_* */ - #include "cmp_local.h" - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include +#include /* for OCSP_REVOKED_STATUS_* */ #define DEFINE_OSSL_CMP_CTX_get0(FIELD, TYPE) \ DEFINE_OSSL_CMP_CTX_get0_NAME(FIELD, FIELD, TYPE) diff --git a/crypto/cmp/cmp_hdr.c b/crypto/cmp/cmp_hdr.c index 74e97afe0f2..51ce908f389 100644 --- a/crypto/cmp/cmp_hdr.c +++ b/crypto/cmp/cmp_hdr.c @@ -12,13 +12,7 @@ /* CMP functions for PKIHeader handling */ #include "cmp_local.h" - -#include - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include +#include /* for RAND_bytes_ex() */ int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno) { diff --git a/crypto/cmp/cmp_http.c b/crypto/cmp/cmp_http.c index d20ea618d84..809763e8461 100644 --- a/crypto/cmp/cmp_http.c +++ b/crypto/cmp/cmp_http.c @@ -9,23 +9,8 @@ * https://www.openssl.org/source/license.html */ -#include -#include - -#include -#include - -#include #include "cmp_local.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include -#include - static int keep_alive(int keep_alive, int body_type, BIO **bios) { if (keep_alive != 0 && bios == NULL diff --git a/crypto/cmp/cmp_local.h b/crypto/cmp/cmp_local.h index bbca4e0ac56..e4185834b5c 100644 --- a/crypto/cmp/cmp_local.h +++ b/crypto/cmp/cmp_local.h @@ -12,18 +12,9 @@ #ifndef OSSL_CRYPTO_CMP_LOCAL_H # define OSSL_CRYPTO_CMP_LOCAL_H -# include "internal/cryptlib.h" - # include -# include - -/* explicit #includes not strictly needed since implied by the above: */ -# include -# include -# include -# include -# include # include "crypto/x509.h" +# include "internal/cryptlib.h" # define IS_NULL_DN(name) (X509_NAME_get_entry(name, 0) == NULL) diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c index 055f14c8f86..a3b6258f526 100644 --- a/crypto/cmp/cmp_msg.c +++ b/crypto/cmp/cmp_msg.c @@ -13,15 +13,7 @@ #include "cmp_local.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include -#include -#include -#include +#include /* for ossl_cms_sign_encrypt() */ OSSL_CMP_MSG *OSSL_CMP_MSG_new(OSSL_LIB_CTX *libctx, const char *propq) { diff --git a/crypto/cmp/cmp_protect.c b/crypto/cmp/cmp_protect.c index f325c4505f5..173b9ac55a0 100644 --- a/crypto/cmp/cmp_protect.c +++ b/crypto/cmp/cmp_protect.c @@ -10,14 +10,7 @@ */ #include "cmp_local.h" -#include "crypto/asn1.h" - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include +#include "crypto/asn1.h" /* for ossl_X509_ALGOR_from_nid() */ /* * This function is also used by the internal verify_PBMAC() in cmp_vfy.c. diff --git a/crypto/cmp/cmp_server.c b/crypto/cmp/cmp_server.c index 6a833f83c53..f4fed6743fa 100644 --- a/crypto/cmp/cmp_server.c +++ b/crypto/cmp/cmp_server.c @@ -11,14 +11,8 @@ /* general CMP server functions */ -#include - #include "cmp_local.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include - /* the context for the generic CMP server */ struct ossl_cmp_srv_ctx_st { OSSL_CMP_CTX *ctx; /* CMP client context reused for transactionID etc. */ diff --git a/crypto/cmp/cmp_status.c b/crypto/cmp/cmp_status.c index b9086d84f84..80849983089 100644 --- a/crypto/cmp/cmp_status.c +++ b/crypto/cmp/cmp_status.c @@ -11,21 +11,8 @@ /* CMP functions for PKIStatusInfo handling and PKIMessage decomposition */ -#include - #include "cmp_local.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include /* needed in case config no-deprecated */ -#include -#include -#include -#include -#include /* for ASN1_R_TOO_SMALL and ASN1_R_TOO_LARGE */ - /* CMP functions related to PKIStatus */ int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si) diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index 47bf38b2af5..fa1d9668b1e 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -12,14 +12,6 @@ /* CMP functions for PKIMessage checking */ #include "cmp_local.h" -#include - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include /* Verify a message protected by signature according to RFC section 5.1.3.3 */ static int verify_signature(const OSSL_CMP_CTX *cmp_ctx, diff --git a/crypto/crmf/crmf_asn.c b/crypto/crmf/crmf_asn.c index a4a0ff1b172..fb3f85a653b 100644 --- a/crypto/crmf/crmf_asn.c +++ b/crypto/crmf/crmf_asn.c @@ -12,12 +12,8 @@ */ #include - #include "crmf_local.h" -/* explicit #includes not strictly needed since implied by the above: */ -#include - ASN1_SEQUENCE(OSSL_CRMF_PRIVATEKEYINFO) = { ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, version, ASN1_INTEGER), ASN1_SIMPLE(OSSL_CRMF_PRIVATEKEYINFO, privateKeyAlgorithm, X509_ALGOR), diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c index 8238496e738..68432e53006 100644 --- a/crypto/crmf/crmf_lib.c +++ b/crypto/crmf/crmf_lib.c @@ -26,19 +26,11 @@ * cases increases its link count) in the parent and so both should be freed up. */ -#include - #include "crmf_local.h" +#include #include "internal/constant_time.h" -#include "internal/sizes.h" -#include "crypto/evp.h" -#include "crypto/x509.h" - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include +#include "internal/sizes.h" /* for OSSL_MAX_NAME_SIZE */ +#include "crypto/x509.h" /* for ossl_x509_check_private_key() */ /*- * atyp = Attribute Type diff --git a/crypto/crmf/crmf_local.h b/crypto/crmf/crmf_local.h index 1cda2cb39eb..d193368bd38 100644 --- a/crypto/crmf/crmf_local.h +++ b/crypto/crmf/crmf_local.h @@ -14,16 +14,7 @@ #ifndef OSSL_CRYPTO_CRMF_LOCAL_H # define OSSL_CRYPTO_CRMF_LOCAL_H -# include -# include /* for CMS_EnvelopedData and CMS_SignedData */ -# include -# include "internal/crmf.h" /* for ossl_crmf_attributetypeandvalue_st */ - -/* explicit #includes not strictly needed since implied by the above: */ -# include -# include -# include -# include +# include "internal/crmf.h" /*- * EncryptedValue ::= SEQUENCE { diff --git a/crypto/crmf/crmf_pbm.c b/crypto/crmf/crmf_pbm.c index e65a3886f72..83f2c3163ec 100644 --- a/crypto/crmf/crmf_pbm.c +++ b/crypto/crmf/crmf_pbm.c @@ -11,22 +11,10 @@ * CRMF implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb. */ -#include - -#include -#include -#include - -/* explicit #includes not strictly needed since implied by the above: */ -#include -#include -#include -#include -#include - -#include "internal/sizes.h" - #include "crmf_local.h" +#include /* for RAND_bytes_ex() */ +#include "internal/sizes.h" /* for OSSL_MAX_NAME_SIZE */ +#include /*- * creates and initializes OSSL_CRMF_PBMPARAMETER (section 4.4)