From: Bob Beck Date: Mon, 27 Apr 2026 18:21:40 +0000 (-0600) Subject: Add missing include guards in include X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d84d82e00619a783d44cbd19a68223c08fa1191;p=thirdparty%2Fopenssl.git Add missing include guards in include Reviewed-by: Tomas Mraz Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs MergeDate: Wed May 6 11:35:47 2026 (Merged from https://github.com/openssl/openssl/pull/31001) --- diff --git a/include/crypto/bn_dh.h b/include/crypto/bn_dh.h index a634a6f8f88..fdb170ab3ff 100644 --- a/include/crypto/bn_dh.h +++ b/include/crypto/bn_dh.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_CRYPTO_BN_DH_H) +#define OSSL_CRYPTO_BN_DH_H + #define declare_dh_bn(x) \ extern const BIGNUM ossl_bignum_dh##x##_p; \ extern const BIGNUM ossl_bignum_dh##x##_q; \ @@ -41,3 +44,5 @@ extern const BIGNUM ossl_bignum_modp_3072_q; extern const BIGNUM ossl_bignum_modp_4096_q; extern const BIGNUM ossl_bignum_modp_6144_q; extern const BIGNUM ossl_bignum_modp_8192_q; + +#endif /* !defined(OSSL_CRYPTO_BN_DH_H) */ diff --git a/include/crypto/context.h b/include/crypto/context.h index 199df30726d..d84b4879a69 100644 --- a/include/crypto/context.h +++ b/include/crypto/context.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_CRYPTO_CONTEXT_H) +#define OSSL_CRYPTO_CONTEXT_H + #include void *ossl_provider_store_new(OSSL_LIB_CTX *); @@ -48,3 +51,5 @@ void ossl_release_default_drbg_ctx(void); #if defined(OPENSSL_THREADS) void ossl_threads_ctx_free(void *); #endif + +#endif /* !defined(OSSL_CRYPTO_CONTEXT_H) */ diff --git a/include/crypto/lms_util.h b/include/crypto/lms_util.h index 622f3d08df4..0f4f4e61432 100644 --- a/include/crypto/lms_util.h +++ b/include/crypto/lms_util.h @@ -9,6 +9,9 @@ /* @brief Internal LMS helper functions */ +#if !defined(OSSL_CRYPTO_LMS_UTIL_H) +#define OSSL_CRYPTO_LMS_UTIL_H + #include "internal/packet.h" #include #include @@ -50,3 +53,5 @@ static ossl_unused ossl_inline int lms_evp_md_ctx_init(EVP_MD_CTX *ctx, const EV } return EVP_DigestInit_ex2(ctx, md, p); } + +#endif /* !defined(OSSL_CRYPTO_LMS_UTIL_H) */ diff --git a/include/crypto/modes.h b/include/crypto/modes.h index 918d4e04b54..b0358da31ee 100644 --- a/include/crypto/modes.h +++ b/include/crypto/modes.h @@ -8,6 +8,9 @@ */ /* This header can move into provider when legacy support is removed */ +#if !defined(OSSL_CRYPTO_MODES_H) +#define OSSL_CRYPTO_MODES_H + #include #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) @@ -229,3 +232,5 @@ struct siv128_context { }; #endif /* OPENSSL_NO_SIV */ + +#endif /* !defined(OSSL_CRYPTO_MODES_H) */ diff --git a/include/crypto/objects.h b/include/crypto/objects.h index f22e9287723..499c769dd06 100644 --- a/include/crypto/objects.h +++ b/include/crypto/objects.h @@ -7,6 +7,11 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_CRYPTO_OBJECTS_H) +#define OSSL_CRYPTO_OBJECTS_H + #include void ossl_obj_cleanup_int(void); + +#endif /* !defined(OSSL_CRYPTO_OBJECTS_H) */ diff --git a/include/internal/bio_tfo.h b/include/internal/bio_tfo.h index bfce90afafe..68b85b0ecc6 100644 --- a/include/internal/bio_tfo.h +++ b/include/internal/bio_tfo.h @@ -13,6 +13,9 @@ */ /* If a supported OS is added here, update test/bio_tfo_test.c */ +#if !defined(OSSL_INTERNAL_BIO_TFO_H) +#define OSSL_INTERNAL_BIO_TFO_H + #if defined(TCP_FASTOPEN) && !defined(OPENSSL_NO_TFO) #if defined(OPENSSL_SYS_MACOSX) || defined(__FreeBSD__) @@ -149,3 +152,5 @@ #endif #endif + +#endif /* !defined(OSSL_INTERNAL_BIO_TFO_H) */ diff --git a/include/internal/namemap.h b/include/internal/namemap.h index 70c6930543c..bea96857dca 100644 --- a/include/internal/namemap.h +++ b/include/internal/namemap.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_INTERNAL_NAMEMAP_H) +#define OSSL_INTERNAL_NAMEMAP_H + #include "internal/cryptlib.h" typedef struct ossl_namemap_st OSSL_NAMEMAP; @@ -39,3 +42,5 @@ int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number, */ int ossl_namemap_add_names(OSSL_NAMEMAP *namemap, int number, const char *names, const char separator); + +#endif /* !defined(OSSL_INTERNAL_NAMEMAP_H) */ diff --git a/include/internal/params.h b/include/internal/params.h index fa948eb69cb..b5b423351f5 100644 --- a/include/internal/params.h +++ b/include/internal/params.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_INTERNAL_PARAMS_H) +#define OSSL_INTERNAL_PARAMS_H + #include #include @@ -39,3 +42,5 @@ int ossl_param_get1_octet_string(const OSSL_PARAM *params, const char *name, */ int ossl_param_get1_concat_octet_string(size_t n, OSSL_PARAM *params[], unsigned char **out, size_t *out_len); + +#endif /* !defined(OSSL_INTERNAL_PARAMS_H) */ diff --git a/include/internal/ssl3_cbc.h b/include/internal/ssl3_cbc.h index 4c102693a0f..89a3efa25d3 100644 --- a/include/internal/ssl3_cbc.h +++ b/include/internal/ssl3_cbc.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_INTERNAL_SSL3_CBC_H) +#define OSSL_INTERNAL_SSL3_CBC_H + #include /* tls_pad.c */ @@ -38,3 +41,5 @@ __owur int ssl3_cbc_digest_record(const EVP_MD *md, size_t data_plus_mac_plus_padding_size, const unsigned char *mac_secret, size_t mac_secret_length, char is_sslv3); + +#endif /* !defined(OSSL_INTERNAL_SSL3_CBC_H) */ diff --git a/include/openssl/ecdh.h b/include/openssl/ecdh.h index 56bd4cc2ce0..3781b82cfad 100644 --- a/include/openssl/ecdh.h +++ b/include/openssl/ecdh.h @@ -7,4 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_OPENSSL_ECDH_H) +#define OSSL_OPENSSL_ECDH_H + #include + +#endif /* !defined(OSSL_OPENSSL_ECDH_H) */ diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h index 56bd4cc2ce0..e84dc60ed74 100644 --- a/include/openssl/ecdsa.h +++ b/include/openssl/ecdsa.h @@ -7,4 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_OPENSSL_ECDSA_H) +#define OSSL_OPENSSL_ECDSA_H + #include + +#endif /* !defined(OSSL_OPENSSL_ECDSA_H) */ diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h index a562299b9f9..c3899c97dc6 100644 --- a/include/openssl/ossl_typ.h +++ b/include/openssl/ossl_typ.h @@ -13,4 +13,9 @@ * This header file only exists for compatibility reasons with older * applications which #include . */ +#if !defined(OSSL_OPENSSL_OSSL_TYP_H) +#define OSSL_OPENSSL_OSSL_TYP_H + #include + +#endif /* !defined(OSSL_OPENSSL_OSSL_TYP_H) */ diff --git a/include/openssl/types.h b/include/openssl/types.h index 1857f833469..cdb21495240 100644 --- a/include/openssl/types.h +++ b/include/openssl/types.h @@ -11,6 +11,9 @@ * Unfortunate workaround to avoid symbol conflict with wincrypt.h * See https://github.com/openssl/openssl/issues/9981 */ +#if !defined(OSSL_OPENSSL_TYPES_H) +#define OSSL_OPENSSL_TYPES_H + #ifdef _WIN32 #define WINCRYPT_USE_SYMBOL_PREFIX #undef X509_NAME @@ -247,3 +250,5 @@ typedef struct ossl_echstore_st OSSL_ECHSTORE; #endif #endif /* OPENSSL_TYPES_H */ + +#endif /* !defined(OSSL_OPENSSL_TYPES_H) */