Commit 5d84d82e00 for openssl.org

commit 5d84d82e00619a783d44cbd19a68223c08fa1191
Author: Bob Beck <beck@openssl.org>
Date:   Mon Apr 27 12:21:40 2026 -0600

    Add missing include guards in include

    Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
    Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    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 a634a6f8f8..fdb170ab3f 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 199df30726..d84b4879a6 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 <openssl/core.h>

 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 622f3d08df..0f4f4e6143 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 <openssl/params.h>
 #include <openssl/core_names.h>
@@ -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 918d4e04b5..b0358da31e 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 <openssl/modes.h>

 #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 f22e928772..499c769dd0 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 <openssl/objects.h>

 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 bfce90afaf..68b85b0ecc 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 70c6930543..bea96857dc 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 fa948eb69c..b5b423351f 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 <stddef.h>
 #include <openssl/params.h>

@@ -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 4c102693a0..89a3efa25d 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 <openssl/evp.h>

 /* 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 56bd4cc2ce..3781b82cfa 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 <openssl/ec.h>
+
+#endif /* !defined(OSSL_OPENSSL_ECDH_H) */
diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h
index 56bd4cc2ce..e84dc60ed7 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 <openssl/ec.h>
+
+#endif /* !defined(OSSL_OPENSSL_ECDSA_H) */
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h
index a562299b9f..c3899c97dc 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 <openssl/ossl_typ.h>.
  */
+#if !defined(OSSL_OPENSSL_OSSL_TYP_H)
+#define OSSL_OPENSSL_OSSL_TYP_H
+
 #include <openssl/types.h>
+
+#endif /* !defined(OSSL_OPENSSL_OSSL_TYP_H) */
diff --git a/include/openssl/types.h b/include/openssl/types.h
index 1857f83346..cdb2149524 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) */