Commit 58ad0bab9f for openssl.org
commit 58ad0bab9f2e9b80ba3b6c71182bfcd2cdbc841d
Author: Bob Beck <beck@openssl.org>
Date: Mon Apr 27 17:21:46 2026 -0600
Guard include files in providers
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:36:06 2026
(Merged from https://github.com/openssl/openssl/pull/31001)
diff --git a/providers/common/include/prov/bio.h b/providers/common/include/prov/bio.h
index 2441995248..72fe6b0d7a 100644
--- a/providers/common/include/prov/bio.h
+++ b/providers/common/include/prov/bio.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H
+
#include <stdarg.h>
#include <openssl/bio.h>
#include <openssl/core.h>
@@ -30,3 +33,5 @@ int ossl_prov_bio_printf(OSSL_CORE_BIO *bio, const char *format, ...);
BIO_METHOD *ossl_bio_prov_init_bio_method(void);
BIO *ossl_bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_BIO_H) */
diff --git a/providers/common/include/prov/der_pq_dsa.h b/providers/common/include/prov/der_pq_dsa.h
index ee22ad56d8..a17bcc7987 100644
--- a/providers/common/include/prov/der_pq_dsa.h
+++ b/providers/common/include/prov/der_pq_dsa.h
@@ -7,5 +7,10 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H
+
int ossl_der_oid_pq_dsa_prehash_digest(const char *oid_digest_name,
const uint8_t **oid, size_t *oidlen, size_t *sz);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_DER_PQ_DSA_H) */
diff --git a/providers/common/include/prov/provider_util.h b/providers/common/include/prov/provider_util.h
index 814eb4acfd..1072fb1ad0 100644
--- a/providers/common/include/prov/provider_util.h
+++ b/providers/common/include/prov/provider_util.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H
+
#include <openssl/provider.h>
#include <openssl/types.h>
@@ -109,3 +112,5 @@ void ossl_prov_cache_exported_algorithms(const OSSL_ALGORITHM_CAPABLE *in,
/* Duplicate a lump of memory safely */
int ossl_prov_memdup(const void *src, size_t src_len,
unsigned char **dest, size_t *dest_len);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDER_UTIL_H) */
diff --git a/providers/common/include/prov/providercommon.h b/providers/common/include/prov/providercommon.h
index f29182a2c1..e470a49d69 100644
--- a/providers/common/include/prov/providercommon.h
+++ b/providers/common/include/prov/providercommon.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H
+
#include <openssl/provider.h>
#include <openssl/core_dispatch.h>
@@ -30,3 +33,5 @@ static ossl_inline int ossl_param_is_empty(const OSSL_PARAM params[])
{
return params == NULL || params->key == NULL;
}
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_PROVIDERCOMMON_H) */
diff --git a/providers/common/include/prov/securitycheck.h b/providers/common/include/prov/securitycheck.h
index 1976b75b43..e36c77c218 100644
--- a/providers/common/include/prov/securitycheck.h
+++ b/providers/common/include/prov/securitycheck.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H)
+#define OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H
+
#include "crypto/types.h"
#include <openssl/ec.h>
@@ -36,3 +39,5 @@ int ossl_digest_get_approved_nid(const EVP_MD *md);
/* Functions that have different implementations for the FIPS_MODULE */
int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md);
+
+#endif /* !defined(OSSL_PROVIDERS_COMMON_INCLUDE_PROV_SECURITYCHECK_H) */
diff --git a/providers/fips/include/fips/fipsindicator.h b/providers/fips/include/fips/fipsindicator.h
index 11c435ac8e..1c1846b1a7 100644
--- a/providers/fips/include/fips/fipsindicator.h
+++ b/providers/fips/include/fips/fipsindicator.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H)
+#define OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H
+
#ifdef FIPS_MODULE
#include <openssl/core.h> /* OSSL_CALLBACK, OSSL_LIB_CTX */
@@ -161,3 +164,5 @@ int ossl_fips_ind_digest_sign_check(OSSL_FIPS_IND *ind, int id,
#define OSSL_FIPS_IND_COPY(dst, src)
#endif
+
+#endif /* !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPS_FIPSINDICATOR_H) */
diff --git a/providers/fips/include/fipscommon.h b/providers/fips/include/fipscommon.h
index 6b646a2558..61d4adef53 100644
--- a/providers/fips/include/fipscommon.h
+++ b/providers/fips/include/fipscommon.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H)
+#define OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H
+
#ifdef FIPS_MODULE
#include <openssl/types.h>
@@ -17,3 +20,5 @@
int ossl_fips_config(OSSL_LIB_CTX *libctx, enum fips_config_id id);
#endif
+
+#endif /* !defined(OSSL_PROVIDERS_FIPS_INCLUDE_FIPSCOMMON_H) */
diff --git a/providers/fips/self_test.h b/providers/fips/self_test.h
index bed8e96825..05c5285e54 100644
--- a/providers/fips/self_test.h
+++ b/providers/fips/self_test.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_FIPS_SELF_TEST_H)
+#define OSSL_PROVIDERS_FIPS_SELF_TEST_H
+
#include <openssl/core_dispatch.h>
#include <openssl/types.h>
#include <openssl/self_test.h>
@@ -177,3 +180,5 @@ typedef struct self_test_st {
extern ST_DEFINITION st_all_tests[ST_ID_MAX];
int ossl_get_self_test_state(self_test_id_t id, enum st_test_state *state);
int ossl_set_self_test_state(self_test_id_t id, enum st_test_state state);
+
+#endif /* !defined(OSSL_PROVIDERS_FIPS_SELF_TEST_H) */
diff --git a/providers/implementations/ciphers/cipher_aes.h b/providers/implementations/ciphers/cipher_aes.h
index f051c5cba6..48235f32d8 100644
--- a/providers/implementations/ciphers/cipher_aes.h
+++ b/providers/implementations/ciphers/cipher_aes.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -55,3 +58,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ctr(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
index 97831da9e7..b2cd2d4019 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H
+
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -63,3 +66,5 @@ typedef struct prov_aes_hmac_sha256_ctx_st {
#define NO_PAYLOAD_LENGTH ((size_t)-1)
#endif /* AES_CBC_HMAC_SHA_CAPABLE */
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
index 8c4e70d40f..fb28056f8c 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H
+
#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -69,3 +72,5 @@ typedef struct {
} CIPH_DIGEST;
#endif /* AES_CBC_HMAC_SHA_ETM_CAPABLE */
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CBC_HMAC_SHA_ETM_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_ccm.h b/providers/implementations/ciphers/cipher_aes_ccm.h
index 089792ee8a..6e4599fdbf 100644
--- a/providers/implementations/ciphers/cipher_aes_ccm.h
+++ b/providers/implementations/ciphers/cipher_aes_ccm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_ccm.h"
@@ -46,3 +49,5 @@ typedef struct prov_aes_ccm_ctx_st {
} PROV_AES_CCM_CTX;
const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keylen);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CCM_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_cfb.h b/providers/implementations/ciphers/cipher_aes_cfb.h
index 7e05c78b7a..416ba585fc 100644
--- a/providers/implementations/ciphers/cipher_aes_cfb.h
+++ b/providers/implementations/ciphers/cipher_aes_cfb.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CFB_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CFB_H
+
#include "prov/ciphercommon.h"
#define ossl_prov_cipher_hw_aes_cfb ossl_prov_cipher_hw_aes_cfb128
@@ -14,3 +17,5 @@
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb8(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_CFB_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_gcm.h b/providers/implementations/ciphers/cipher_aes_gcm.h
index 0cd1d5a1ad..33819705de 100644
--- a/providers/implementations/ciphers/cipher_aes_gcm.h
+++ b/providers/implementations/ciphers/cipher_aes_gcm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_gcm.h"
@@ -43,3 +46,5 @@ typedef struct prov_aes_gcm_ctx_st {
} PROV_AES_GCM_CTX;
const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_gcm_siv.h b/providers/implementations/ciphers/cipher_aes_gcm_siv.h
index dbee05beda..7333c39b0b 100644
--- a/providers/implementations/ciphers/cipher_aes_gcm_siv.h
+++ b/providers/implementations/ciphers/cipher_aes_gcm_siv.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -74,3 +77,5 @@ static ossl_inline uint64_t GSWAP8(uint64_t n)
result <<= 32;
return result | GSWAP4(n >> 32);
}
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_GCM_SIV_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_ocb.h b/providers/implementations/ciphers/cipher_aes_ocb.h
index b034825603..dfea8a1fc8 100644
--- a/providers/implementations/ciphers/cipher_aes_ocb.h
+++ b/providers/implementations/ciphers/cipher_aes_ocb.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -37,3 +40,5 @@ typedef struct prov_aes_ocb_ctx_st {
} PROV_AES_OCB_CTX;
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ocb(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_OCB_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_siv.h b/providers/implementations/ciphers/cipher_aes_siv.h
index 28f6668a29..cd1ce9c06b 100644
--- a/providers/implementations/ciphers/cipher_aes_siv.h
+++ b/providers/implementations/ciphers/cipher_aes_siv.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H
+
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
#include "crypto/siv.h"
@@ -34,3 +37,5 @@ typedef struct prov_siv_ctx_st {
} PROV_AES_SIV_CTX;
const PROV_CIPHER_HW_AES_SIV *ossl_prov_cipher_hw_aes_siv(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_SIV_H) */
diff --git a/providers/implementations/ciphers/cipher_aes_xts.h b/providers/implementations/ciphers/cipher_aes_xts.h
index 2ffc143f21..18dc295e47 100644
--- a/providers/implementations/ciphers/cipher_aes_xts.h
+++ b/providers/implementations/ciphers/cipher_aes_xts.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H
+
#include <openssl/aes.h>
#include "prov/ciphercommon.h"
#include "crypto/aes_platform.h"
@@ -58,3 +61,5 @@ typedef struct prov_aes_xts_ctx_st {
} PROV_AES_XTS_CTX;
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_AES_XTS_H) */
diff --git a/providers/implementations/ciphers/cipher_aria.h b/providers/implementations/ciphers/cipher_aria.h
index 563262aee8..61f2f1b459 100644
--- a/providers/implementations/ciphers/cipher_aria.h
+++ b/providers/implementations/ciphers/cipher_aria.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H
+
#include "crypto/aria.h"
#include "prov/ciphercommon.h"
@@ -27,3 +30,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb1(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb8(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_ctr(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_H) */
diff --git a/providers/implementations/ciphers/cipher_aria_ccm.h b/providers/implementations/ciphers/cipher_aria_ccm.h
index 7de71e7c00..51b084e65e 100644
--- a/providers/implementations/ciphers/cipher_aria_ccm.h
+++ b/providers/implementations/ciphers/cipher_aria_ccm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H
+
#include "crypto/aria.h"
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_ccm.h"
@@ -20,3 +23,5 @@ typedef struct prov_aria_ccm_ctx_st {
} PROV_ARIA_CCM_CTX;
const PROV_CCM_HW *ossl_prov_aria_hw_ccm(size_t keylen);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_CCM_H) */
diff --git a/providers/implementations/ciphers/cipher_aria_gcm.h b/providers/implementations/ciphers/cipher_aria_gcm.h
index 622053a559..984d2b8396 100644
--- a/providers/implementations/ciphers/cipher_aria_gcm.h
+++ b/providers/implementations/ciphers/cipher_aria_gcm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H
+
#include "crypto/aria.h"
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_gcm.h"
@@ -20,3 +23,5 @@ typedef struct prov_aria_gcm_ctx_st {
} PROV_ARIA_GCM_CTX;
const PROV_GCM_HW *ossl_prov_aria_hw_gcm(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_ARIA_GCM_H) */
diff --git a/providers/implementations/ciphers/cipher_blowfish.h b/providers/implementations/ciphers/cipher_blowfish.h
index 18c824fed1..8c3366866f 100644
--- a/providers/implementations/ciphers/cipher_blowfish.h
+++ b/providers/implementations/ciphers/cipher_blowfish.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H
+
#include <openssl/blowfish.h>
#include "prov/ciphercommon.h"
@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ofb64(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_BLOWFISH_H) */
diff --git a/providers/implementations/ciphers/cipher_camellia.h b/providers/implementations/ciphers/cipher_camellia.h
index 2c1156ae92..1ef9106823 100644
--- a/providers/implementations/ciphers/cipher_camellia.h
+++ b/providers/implementations/ciphers/cipher_camellia.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H
+
#include <openssl/camellia.h>
#include "prov/ciphercommon.h"
#include "crypto/cmll_platform.h"
@@ -28,3 +31,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb1(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb8(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_ctr(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAMELLIA_H) */
diff --git a/providers/implementations/ciphers/cipher_cast.h b/providers/implementations/ciphers/cipher_cast.h
index d0451861e3..11164f543f 100644
--- a/providers/implementations/ciphers/cipher_cast.h
+++ b/providers/implementations/ciphers/cipher_cast.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H
+
#include <openssl/cast.h>
#include "prov/ciphercommon.h"
@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ofb64(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CAST_H) */
diff --git a/providers/implementations/ciphers/cipher_chacha20.h b/providers/implementations/ciphers/cipher_chacha20.h
index ed531d7933..5338ad949c 100644
--- a/providers/implementations/ciphers/cipher_chacha20.h
+++ b/providers/implementations/ciphers/cipher_chacha20.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H
+
#include "include/crypto/chacha.h"
#include "prov/ciphercommon.h"
@@ -32,3 +35,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20(size_t keybits);
OSSL_FUNC_cipher_encrypt_init_fn ossl_chacha20_einit;
OSSL_FUNC_cipher_decrypt_init_fn ossl_chacha20_dinit;
void ossl_chacha20_initctx(PROV_CHACHA20_CTX *ctx);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_H) */
diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305.h b/providers/implementations/ciphers/cipher_chacha20_poly1305.h
index 2e82fdb947..7a4575fa2e 100644
--- a/providers/implementations/ciphers/cipher_chacha20_poly1305.h
+++ b/providers/implementations/ciphers/cipher_chacha20_poly1305.h
@@ -9,6 +9,9 @@
/* Dispatch functions for chacha20_poly1305 cipher */
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H
+
#include "include/crypto/poly1305.h"
#include "cipher_chacha20.h"
@@ -43,3 +46,5 @@ typedef struct prov_cipher_hw_chacha_aead_st {
} PROV_CIPHER_HW_CHACHA20_POLY1305;
const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20_poly1305(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CHACHA20_POLY1305_H) */
diff --git a/providers/implementations/ciphers/cipher_cts.h b/providers/implementations/ciphers/cipher_cts.h
index b3a677b6aa..8bae4f8d3b 100644
--- a/providers/implementations/ciphers/cipher_cts.h
+++ b/providers/implementations/ciphers/cipher_cts.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H
+
#include "crypto/evp.h"
/* NOTE: The underlying block cipher is CBC so we reuse most of the code */
@@ -50,3 +53,5 @@ OSSL_FUNC_cipher_final_fn ossl_cipher_cbc_cts_block_final;
const char *ossl_cipher_cbc_cts_mode_id2name(unsigned int id);
int ossl_cipher_cbc_cts_mode_name2id(const char *name);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_CTS_H) */
diff --git a/providers/implementations/ciphers/cipher_des.h b/providers/implementations/ciphers/cipher_des.h
index 9fd72f0068..3a965159b7 100644
--- a/providers/implementations/ciphers/cipher_des.h
+++ b/providers/implementations/ciphers/cipher_des.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H
+
#include <openssl/des.h>
#include "crypto/des_platform.h"
@@ -31,3 +34,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_ofb64(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb64(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb1(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_des_cfb8(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_DES_H) */
diff --git a/providers/implementations/ciphers/cipher_idea.h b/providers/implementations/ciphers/cipher_idea.h
index 44f9571ff3..dbb5c332c1 100644
--- a/providers/implementations/ciphers/cipher_idea.h
+++ b/providers/implementations/ciphers/cipher_idea.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H
+
#include <openssl/idea.h>
#include "prov/ciphercommon.h"
@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ofb64(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_IDEA_H) */
diff --git a/providers/implementations/ciphers/cipher_rc2.h b/providers/implementations/ciphers/cipher_rc2.h
index bfb1d45495..025f331507 100644
--- a/providers/implementations/ciphers/cipher_rc2.h
+++ b/providers/implementations/ciphers/cipher_rc2.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H
+
#include <openssl/rc2.h>
#include "prov/ciphercommon.h"
@@ -26,3 +29,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ofb64(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC2_H) */
diff --git a/providers/implementations/ciphers/cipher_rc4.h b/providers/implementations/ciphers/cipher_rc4.h
index 8bb6f22652..ed7ffe2339 100644
--- a/providers/implementations/ciphers/cipher_rc4.h
+++ b/providers/implementations/ciphers/cipher_rc4.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H
+
#include <openssl/rc4.h>
#include "prov/ciphercommon.h"
@@ -19,3 +22,5 @@ typedef struct prov_rc4_ctx_st {
} PROV_RC4_CTX;
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_H) */
diff --git a/providers/implementations/ciphers/cipher_rc4_hmac_md5.h b/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
index 87fa8e060d..ad243cd0a3 100644
--- a/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
+++ b/providers/implementations/ciphers/cipher_rc4_hmac_md5.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H
+
#include <openssl/rc4.h>
#include <openssl/md5.h>
#include "prov/ciphercommon.h"
@@ -34,3 +37,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4_hmac_md5(size_t keybits);
void rc4_md5_enc(RC4_KEY *key, const void *in0, void *out,
MD5_CTX *ctx, const void *inp, size_t blocks);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC4_HMAC_MD5_H) */
diff --git a/providers/implementations/ciphers/cipher_rc5.h b/providers/implementations/ciphers/cipher_rc5.h
index 0662937f68..b2a5ff91bc 100644
--- a/providers/implementations/ciphers/cipher_rc5.h
+++ b/providers/implementations/ciphers/cipher_rc5.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H
+
#include <openssl/rc5.h>
#include "prov/ciphercommon.h"
@@ -23,3 +26,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ofb64(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cfb64(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_RC5_H) */
diff --git a/providers/implementations/ciphers/cipher_seed.h b/providers/implementations/ciphers/cipher_seed.h
index 750ab8deac..50460d1fa7 100644
--- a/providers/implementations/ciphers/cipher_seed.h
+++ b/providers/implementations/ciphers/cipher_seed.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H
+
#include <openssl/seed.h>
#include "prov/ciphercommon.h"
@@ -22,3 +25,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cbc(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ofb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cfb128(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SEED_H) */
diff --git a/providers/implementations/ciphers/cipher_sm4.h b/providers/implementations/ciphers/cipher_sm4.h
index b061022411..e11ad45e1f 100644
--- a/providers/implementations/ciphers/cipher_sm4.h
+++ b/providers/implementations/ciphers/cipher_sm4.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H
+
#include "prov/ciphercommon.h"
#include "crypto/sm4.h"
#include "crypto/sm4_platform.h"
@@ -24,3 +27,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ecb(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ctr(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ofb128(size_t keybits);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_cfb128(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_H) */
diff --git a/providers/implementations/ciphers/cipher_sm4_ccm.h b/providers/implementations/ciphers/cipher_sm4_ccm.h
index 61d4466132..2409f862de 100644
--- a/providers/implementations/ciphers/cipher_sm4_ccm.h
+++ b/providers/implementations/ciphers/cipher_sm4_ccm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H
+
#include "crypto/sm4.h"
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_ccm.h"
@@ -21,3 +24,5 @@ typedef struct prov_sm4_ccm_ctx_st {
} PROV_SM4_CCM_CTX;
const PROV_CCM_HW *ossl_prov_sm4_hw_ccm(size_t keylen);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_CCM_H) */
diff --git a/providers/implementations/ciphers/cipher_sm4_gcm.h b/providers/implementations/ciphers/cipher_sm4_gcm.h
index 6bc9a4d34b..cd38a75a65 100644
--- a/providers/implementations/ciphers/cipher_sm4_gcm.h
+++ b/providers/implementations/ciphers/cipher_sm4_gcm.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H
+
#include "crypto/sm4.h"
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_gcm.h"
@@ -20,3 +23,5 @@ typedef struct prov_sm4_gcm_ctx_st {
} PROV_SM4_GCM_CTX;
const PROV_GCM_HW *ossl_prov_sm4_hw_gcm(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_GCM_H) */
diff --git a/providers/implementations/ciphers/cipher_sm4_xts.h b/providers/implementations/ciphers/cipher_sm4_xts.h
index 57dcdb6ccf..3693eaa4df 100644
--- a/providers/implementations/ciphers/cipher_sm4_xts.h
+++ b/providers/implementations/ciphers/cipher_sm4_xts.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H
+
#include <crypto/sm4.h>
#include "prov/ciphercommon.h"
#include "crypto/sm4_platform.h"
@@ -44,3 +47,5 @@ typedef struct prov_sm4_xts_ctx_st {
} PROV_SM4_XTS_CTX;
const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_xts(size_t keybits);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_SM4_XTS_H) */
diff --git a/providers/implementations/ciphers/cipher_tdes.h b/providers/implementations/ciphers/cipher_tdes.h
index 7aa4532688..3ba509f321 100644
--- a/providers/implementations/ciphers/cipher_tdes.h
+++ b/providers/implementations/ciphers/cipher_tdes.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H
+
#include <openssl/des.h>
#include <openssl/core_dispatch.h>
#include "prov/securitycheck.h"
@@ -108,3 +111,5 @@ int ossl_cipher_hw_tdes_ecb(PROV_CIPHER_CTX *ctx, unsigned char *out,
const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cbc(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_ecb(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_H) */
diff --git a/providers/implementations/ciphers/cipher_tdes_default.h b/providers/implementations/ciphers/cipher_tdes_default.h
index dc8458b5da..adc3af7b3b 100644
--- a/providers/implementations/ciphers/cipher_tdes_default.h
+++ b/providers/implementations/ciphers/cipher_tdes_default.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H
+
#include "prov/ciphercommon.h"
#include "cipher_tdes.h"
@@ -23,3 +26,5 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_cfb(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_desx_cbc(void);
const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_wrap_cbc(void);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHER_TDES_DEFAULT_H) */
diff --git a/providers/implementations/ciphers/ciphercommon_local.h b/providers/implementations/ciphers/ciphercommon_local.h
index f142722f28..05ada2dd17 100644
--- a/providers/implementations/ciphers/ciphercommon_local.h
+++ b/providers/implementations/ciphers/ciphercommon_local.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H
+
#include "prov/ciphercommon.h"
void ossl_cipher_padblock(unsigned char *buf, size_t *buflen, size_t blocksize);
@@ -14,3 +17,5 @@ int ossl_cipher_unpadblock(unsigned char *buf, size_t *buflen, size_t blocksize)
int ossl_cipher_tlsunpadblock(OSSL_LIB_CTX *libctx, unsigned int tlsversion,
unsigned char *buf, size_t *buflen, size_t blocksize,
unsigned char **mac, int *alloced, size_t macsize, int aead);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_CIPHERS_CIPHERCOMMON_LOCAL_H) */
diff --git a/providers/implementations/digests/blake2_impl.h b/providers/implementations/digests/blake2_impl.h
index dd10beae40..a4322b5762 100644
--- a/providers/implementations/digests/blake2_impl.h
+++ b/providers/implementations/digests/blake2_impl.h
@@ -14,6 +14,9 @@
* can be found at https://blake2.net.
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H
+
#include <string.h>
#include "internal/endian.h"
@@ -116,3 +119,5 @@ static ossl_inline uint64_t rotr64(const uint64_t w, const unsigned int c)
{
return (w >> c) | (w << (64 - c));
}
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_DIGESTS_BLAKE2_IMPL_H) */
diff --git a/providers/implementations/include/prov/decoders.h b/providers/implementations/include/prov/decoders.h
index e38f15b3c2..84a822f04e 100644
--- a/providers/implementations/include/prov/decoders.h
+++ b/providers/implementations/include/prov/decoders.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H
+
#include <openssl/core.h>
int ossl_epki2pki_der_decode(unsigned char *der, long der_len, int selection,
@@ -18,3 +21,5 @@ int ossl_spki2typespki_der_decode(unsigned char *der, long len, int selection,
OSSL_CALLBACK *data_cb, void *data_cbarg,
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg,
OSSL_LIB_CTX *libctx, const char *propq);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_DECODERS_H) */
diff --git a/providers/implementations/include/prov/eckem.h b/providers/implementations/include/prov/eckem.h
index 8dedace5f7..9fa48323b2 100644
--- a/providers/implementations/include/prov/eckem.h
+++ b/providers/implementations/include/prov/eckem.h
@@ -7,7 +7,12 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H
+
#define KEM_MODE_UNDEFINED 0
#define KEM_MODE_DHKEM 1
int ossl_eckem_modename2id(const char *name);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ECKEM_H) */
diff --git a/providers/implementations/include/prov/endecoder_local.h b/providers/implementations/include/prov/endecoder_local.h
index bfdef52455..e6c2eaff27 100644
--- a/providers/implementations/include/prov/endecoder_local.h
+++ b/providers/implementations/include/prov/endecoder_local.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H
+
#include <openssl/core.h>
#include <openssl/core_dispatch.h>
#include <openssl/types.h>
@@ -26,3 +29,5 @@ void *ossl_prov_import_key(const OSSL_DISPATCH *fns, void *provctx,
void ossl_prov_free_key(const OSSL_DISPATCH *fns, void *key);
int ossl_read_der(PROV_CTX *provctx, OSSL_CORE_BIO *cin, unsigned char **data,
long *len);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ENDECODER_LOCAL_H) */
diff --git a/providers/implementations/include/prov/file_store_local.h b/providers/implementations/include/prov/file_store_local.h
index 576d8d847f..d7f001d5cd 100644
--- a/providers/implementations/include/prov/file_store_local.h
+++ b/providers/implementations/include/prov/file_store_local.h
@@ -7,4 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H
+
extern const OSSL_ALGORITHM ossl_any_to_obj_algorithm[];
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_FILE_STORE_LOCAL_H) */
diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h
index 76b3d6d3e3..2b0782bd0b 100644
--- a/providers/implementations/include/prov/implementations.h
+++ b/providers/implementations/include/prov/implementations.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H
+
#include <openssl/core.h>
#include <openssl/types.h>
@@ -884,3 +887,5 @@ extern const OSSL_DISPATCH ossl_SubjectPublicKeyInfo_der_to_ml_dsa_87_decoder_fu
extern const OSSL_DISPATCH ossl_generic_skeymgmt_functions[];
extern const OSSL_DISPATCH ossl_aes_skeymgmt_functions[];
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_IMPLEMENTATIONS_H) */
diff --git a/providers/implementations/include/prov/kdfexchange.h b/providers/implementations/include/prov/kdfexchange.h
index cf08f785ee..497e4736d2 100644
--- a/providers/implementations/include/prov/kdfexchange.h
+++ b/providers/implementations/include/prov/kdfexchange.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H
+
#include <stdlib.h>
#include <openssl/crypto.h>
#include "internal/refcount.h"
@@ -21,3 +24,5 @@ typedef struct kdf_data_st KDF_DATA;
KDF_DATA *ossl_kdf_data_new(void *provctx);
void ossl_kdf_data_free(KDF_DATA *kdfdata);
int ossl_kdf_data_up_ref(KDF_DATA *kdfdata);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_KDFEXCHANGE_H) */
diff --git a/providers/implementations/include/prov/macsignature.h b/providers/implementations/include/prov/macsignature.h
index e13ff362ce..d1cebdacf0 100644
--- a/providers/implementations/include/prov/macsignature.h
+++ b/providers/implementations/include/prov/macsignature.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H
+
#include <stdlib.h>
#include <openssl/crypto.h>
#include "internal/refcount.h"
@@ -27,3 +30,5 @@ typedef struct mac_key_st MAC_KEY;
MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
void ossl_mac_key_free(MAC_KEY *mackey);
int ossl_mac_key_up_ref(MAC_KEY *mackey);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_MACSIGNATURE_H) */
diff --git a/providers/implementations/include/prov/ml_dsa.h b/providers/implementations/include/prov/ml_dsa.h
index fca8a30625..d94dbd55ea 100644
--- a/providers/implementations/include/prov/ml_dsa.h
+++ b/providers/implementations/include/prov/ml_dsa.h
@@ -7,8 +7,13 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H
+
#include "crypto/ml_dsa.h"
#include "prov/provider_ctx.h"
ML_DSA_KEY *
ossl_prov_ml_dsa_new(PROV_CTX *provctx, const char *propq, int evp_type);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_DSA_H) */
diff --git a/providers/implementations/include/prov/ml_kem.h b/providers/implementations/include/prov/ml_kem.h
index b82ef1baa0..33e0efc28b 100644
--- a/providers/implementations/include/prov/ml_kem.h
+++ b/providers/implementations/include/prov/ml_kem.h
@@ -7,8 +7,13 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H
+
#include "crypto/ml_kem.h"
#include "prov/provider_ctx.h"
ML_KEM_KEY *
ossl_prov_ml_kem_new(PROV_CTX *provctx, const char *propq, int evp_type);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_ML_KEM_H) */
diff --git a/providers/implementations/include/prov/names.h b/providers/implementations/include/prov/names.h
index a80eb99a08..09146dd01e 100644
--- a/providers/implementations/include/prov/names.h
+++ b/providers/implementations/include/prov/names.h
@@ -40,6 +40,9 @@
* Symmetric ciphers
* -----------------
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H
+
#define PROV_NAMES_AES "AES:2.16.840.1.101.3.4.1"
#define PROV_DESCS_AES "OpenSSL AES opaque secret key"
#define PROV_NAMES_GENERIC "GENERIC-SECRET"
@@ -465,3 +468,5 @@
#define PROV_DESCS_SLH_DSA_SHAKE_192F "OpenSSL SLH-DSA-SHAKE-192f implementation"
#define PROV_DESCS_SLH_DSA_SHAKE_256S "OpenSSL SLH-DSA-SHAKE-256s implementation"
#define PROV_DESCS_SLH_DSA_SHAKE_256F "OpenSSL SLH-DSA-SHAKE-256f implementation"
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_NAMES_H) */
diff --git a/providers/implementations/include/prov/seeding.h b/providers/implementations/include/prov/seeding.h
index a6d720dfe4..7bdc0cbe5d 100644
--- a/providers/implementations/include/prov/seeding.h
+++ b/providers/implementations/include/prov/seeding.h
@@ -7,6 +7,9 @@
* https://www.openssl.org/source/license.html
*/
+#if !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H)
+#define OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H
+
#include "prov/provider_ctx.h"
#include "crypto/rand_pool.h"
@@ -28,3 +31,5 @@ size_t ossl_prov_get_nonce(PROV_CTX *prov_ctx, unsigned char **pout,
const void *salt, size_t salt_len);
void ossl_prov_cleanup_nonce(PROV_CTX *prov_ctx, unsigned char *buf,
size_t len);
+
+#endif /* !defined(OSSL_PROVIDERS_IMPLEMENTATIONS_INCLUDE_PROV_SEEDING_H) */