From: Bob Beck Date: Mon, 27 Apr 2026 23:21:46 +0000 (-0600) Subject: Guard include files in providers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58ad0bab9f2e9b80ba3b6c71182bfcd2cdbc841d;p=thirdparty%2Fopenssl.git Guard include files in providers Reviewed-by: Tomas Mraz Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs 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 24419952480..72fe6b0d7a4 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 #include #include @@ -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 ee22ad56d8d..a17bcc79875 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 814eb4acfd4..1072fb1ad07 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 #include @@ -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 f29182a2c1f..e470a49d69a 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 #include @@ -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 1976b75b43a..e36c77c2180 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 @@ -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 11c435ac8ec..1c1846b1a73 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 /* 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 6b646a2558c..61d4adef532 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 @@ -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 bed8e968252..05c5285e540 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 #include #include @@ -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 f051c5cba60..48235f32d8f 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 #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 97831da9e78..b2cd2d4019b 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 8c4e70d40f8..fb28056f8c8 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 #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 089792ee8a8..6e4599fdbf2 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 #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 7e05c78b7a3..416ba585fcd 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 0cd1d5a1ade..33819705dea 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 #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 dbee05bedac..7333c39b0bf 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 #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 b0348256034..dfea8a1fc8c 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 #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 28f6668a29a..cd1ce9c06b5 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 2ffc143f21f..18dc295e47a 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 #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 563262aee8b..61f2f1b459f 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 7de71e7c001..51b084e65ea 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 622053a5594..984d2b83964 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 18c824fed1e..8c3366866f3 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 #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 2c1156ae92d..1ef91068232 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 #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 d0451861e32..11164f543f6 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 #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 ed531d7933b..5338ad949cc 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 2e82fdb9478..7a4575fa2e8 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 b3a677b6aa5..8bae4f8d3ba 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 9fd72f00688..3a965159b78 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 #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 44f9571ff37..dbb5c332c15 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 #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 bfb1d45495d..025f331507f 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 #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 8bb6f226523..ed7ffe23393 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 #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 87fa8e060db..ad243cd0a35 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 #include #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 0662937f68e..b2a5ff91bc6 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 #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 750ab8deac8..50460d1fa7a 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 #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 b061022411b..e11ad45e1f6 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 61d44661325..2409f862dea 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 6bc9a4d34b6..cd38a75a65c 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 57dcdb6ccf3..3693eaa4df3 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 #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 7aa45326889..3ba509f3216 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 #include #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 dc8458b5daf..adc3af7b3b4 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 f142722f28b..05ada2dd17a 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 dd10beae405..a4322b57620 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 #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 e38f15b3c2b..84a822f04e9 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 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 8dedace5f7a..9fa48323b26 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 bfdef524550..e6c2eaff276 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 #include #include @@ -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 576d8d847ff..d7f001d5cd5 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 76b3d6d3e3d..2b0782bd0b4 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 #include @@ -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 cf08f785ee0..497e4736d2a 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 #include #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 e13ff362ce0..d1cebdacf09 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 #include #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 fca8a306253..d94dbd55ead 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 b82ef1baa03..33e0efc28bc 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 a80eb99a081..09146dd01ed 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 a6d720dfe42..7bdc0cbe5d8 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) */