From: Bob Beck Date: Mon, 27 Apr 2026 18:39:18 +0000 (-0600) Subject: Add missing header guards in local crypto includes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b80bec55a0aea54cab75e38cf0efb943bedc61a9;p=thirdparty%2Fopenssl.git Add missing header guards in local crypto includes. These are guarded with "OSSL_LIBCRYPTO" to ensure the namespace is distinct from the "OSSL_CRYPTO" guards used in include/crypto Reviewed-by: Tomas Mraz Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs MergeDate: Wed May 6 11:35:55 2026 (Merged from https://github.com/openssl/openssl/pull/31001) --- diff --git a/crypto/asn1/asn1_local.h b/crypto/asn1/asn1_local.h index ae6288f446f..3f230683d72 100644 --- a/crypto/asn1/asn1_local.h +++ b/crypto/asn1/asn1_local.h @@ -9,6 +9,9 @@ /* Internal ASN1 structures and functions: not for application use */ +#if !defined(OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H) +#define OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H + #include "crypto/asn1.h" typedef const ASN1_VALUE const_ASN1_VALUE; @@ -96,3 +99,5 @@ int ossl_asn1_item_ex_new_intern(ASN1_VALUE **pval, const ASN1_ITEM *it, OSSL_LIB_CTX *libctx, const char *propq); int ossl_asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm); int ossl_asn1_time_tm_to_time_t(const struct tm *tm, time_t *out); + +#endif /* !defined(OSSL_LIBCRYPTO_ASN1_ASN1_LOCAL_H) */ diff --git a/crypto/asn1/tbl_standard.h b/crypto/asn1/tbl_standard.h index da9c299bed8..79f2f06c753 100644 --- a/crypto/asn1/tbl_standard.h +++ b/crypto/asn1/tbl_standard.h @@ -9,6 +9,9 @@ /* size limits: this stuff is taken straight from RFC3280 */ +#if !defined(OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H) +#define OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H + #define ub_name 32768 #define ub_common_name 64 #define ub_locality_name 128 @@ -59,3 +62,5 @@ static const ASN1_STRING_TABLE tbl_standard[] = { { NID_dnsName, 0, -1, B_ASN1_UTF8STRING, STABLE_NO_MASK }, { NID_id_on_SmtpUTF8Mailbox, 1, ub_email_address, B_ASN1_UTF8STRING, STABLE_NO_MASK } }; + +#endif /* !defined(OSSL_LIBCRYPTO_ASN1_TBL_STANDARD_H) */ diff --git a/crypto/async/async_local.h b/crypto/async/async_local.h index 7d3058e05ec..9db3103c37e 100644 --- a/crypto/async/async_local.h +++ b/crypto/async/async_local.h @@ -11,6 +11,9 @@ * Must do this before including any header files, because on MacOS/X * includes which includes */ +#if !defined(OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H) +#define OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H + #if defined(__APPLE__) && defined(__MACH__) && !defined(_XOPEN_SOURCE) #define _XOPEN_SOURCE /* Otherwise incomplete ucontext_t structure */ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -80,3 +83,5 @@ void async_start_func(void); async_ctx *async_get_ctx(void); void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx); + +#endif /* !defined(OSSL_LIBCRYPTO_ASYNC_ASYNC_LOCAL_H) */ diff --git a/crypto/bf/bf_pi.h b/crypto/bf/bf_pi.h index ffb3b3e9b35..6971865c1b2 100644 --- a/crypto/bf/bf_pi.h +++ b/crypto/bf/bf_pi.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_BF_BF_PI_H) +#define OSSL_LIBCRYPTO_BF_BF_PI_H + static const BF_KEY bf_init = { { 0x243f6a88L, 0x85a308d3L, 0x13198a2eL, 0x03707344L, 0xa4093822L, 0x299f31d0L, 0x082efa98L, 0xec4e6c89L, @@ -1040,3 +1043,5 @@ static const BF_KEY bf_init = { 0x3ac372e6L, } }; + +#endif /* !defined(OSSL_LIBCRYPTO_BF_BF_PI_H) */ diff --git a/crypto/bio/bio_local.h b/crypto/bio/bio_local.h index 60fb944928c..36f72f5df1b 100644 --- a/crypto/bio/bio_local.h +++ b/crypto/bio/bio_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H) +#define OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H + #include "internal/e_os.h" #include "internal/sockets.h" #include "internal/bio_addr.h" @@ -178,3 +181,5 @@ void bio_sock_cleanup_int(void); #endif #endif + +#endif /* !defined(OSSL_LIBCRYPTO_BIO_BIO_LOCAL_H) */ diff --git a/crypto/cast/cast_local.h b/crypto/cast/cast_local.h index f24b8bccdc0..a3ea4d14de2 100644 --- a/crypto/cast/cast_local.h +++ b/crypto/cast/cast_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H) +#define OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H + #ifdef OPENSSL_SYS_WIN32 #include #endif @@ -166,3 +169,5 @@ extern const CAST_LONG CAST_S_table4[256]; extern const CAST_LONG CAST_S_table5[256]; extern const CAST_LONG CAST_S_table6[256]; extern const CAST_LONG CAST_S_table7[256]; + +#endif /* !defined(OSSL_LIBCRYPTO_CAST_CAST_LOCAL_H) */ diff --git a/crypto/cast/cast_s.h b/crypto/cast/cast_s.h index 345b4dd7317..c76770f3447 100644 --- a/crypto/cast/cast_s.h +++ b/crypto/cast/cast_s.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_CAST_CAST_S_H) +#define OSSL_LIBCRYPTO_CAST_CAST_S_H + const CAST_LONG CAST_S_table0[256] = { 0x30fb40d4, 0x9fa0ff0b, @@ -2078,3 +2081,5 @@ const CAST_LONG CAST_S_table7[256] = { 0x8db2a283, 0xea8bf59e, }; + +#endif /* !defined(OSSL_LIBCRYPTO_CAST_CAST_S_H) */ diff --git a/crypto/comp/comp_local.h b/crypto/comp/comp_local.h index fbc5ab318c1..913eb09f70d 100644 --- a/crypto/comp/comp_local.h +++ b/crypto/comp/comp_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H) +#define OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H + struct comp_method_st { int type; /* NID for compression library */ const char *name; /* A text string to identify the library */ @@ -28,3 +31,5 @@ struct comp_ctx_st { unsigned long expand_out; void *data; }; + +#endif /* !defined(OSSL_LIBCRYPTO_COMP_COMP_LOCAL_H) */ diff --git a/crypto/conf/conf_local.h b/crypto/conf/conf_local.h index f3b16f11385..1ecef7549a3 100644 --- a/crypto/conf/conf_local.h +++ b/crypto/conf/conf_local.h @@ -7,5 +7,10 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H) +#define OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H + #include void ossl_config_add_ssl_module(void); + +#endif /* !defined(OSSL_LIBCRYPTO_CONF_CONF_LOCAL_H) */ diff --git a/crypto/ct/ct_local.h b/crypto/ct/ct_local.h index a06e42bb5be..2fffc1a841e 100644 --- a/crypto/ct/ct_local.h +++ b/crypto/ct/ct_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_CT_CT_LOCAL_H) +#define OSSL_LIBCRYPTO_CT_CT_LOCAL_H + #include #include #include @@ -215,3 +218,5 @@ __owur int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len); * Handlers for Certificate Transparency X509v3/OCSP extensions */ extern const X509V3_EXT_METHOD ossl_v3_ct_scts[3]; + +#endif /* !defined(OSSL_LIBCRYPTO_CT_CT_LOCAL_H) */ diff --git a/crypto/des/spr.h b/crypto/des/spr.h index 955fbc2989d..3687bb37209 100644 --- a/crypto/des/spr.h +++ b/crypto/des/spr.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_DES_SPR_H) +#define OSSL_LIBCRYPTO_DES_SPR_H + const DES_LONG DES_SPtrans[8][64] = { { /* nibble 0 */ @@ -545,3 +548,5 @@ const DES_LONG DES_SPtrans[8][64] = { 0x00820080L, } }; + +#endif /* !defined(OSSL_LIBCRYPTO_DES_SPR_H) */ diff --git a/crypto/dh/dh_local.h b/crypto/dh/dh_local.h index 177f055a679..ea6c378a9d9 100644 --- a/crypto/dh/dh_local.h +++ b/crypto/dh/dh_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_DH_DH_LOCAL_H) +#define OSSL_LIBCRYPTO_DH_DH_LOCAL_H + #include #include "internal/refcount.h" #include "internal/ffc.h" @@ -57,3 +60,5 @@ struct dh_method { int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb); }; + +#endif /* !defined(OSSL_LIBCRYPTO_DH_DH_LOCAL_H) */ diff --git a/crypto/dsa/dsa_local.h b/crypto/dsa/dsa_local.h index a744463c876..566bcb0def0 100644 --- a/crypto/dsa/dsa_local.h +++ b/crypto/dsa/dsa_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H) +#define OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H + #include #include "internal/refcount.h" #include "internal/ffc.h" @@ -70,3 +73,5 @@ struct dsa_method { DSA_SIG *ossl_dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa, unsigned int nonce_type, const char *digestname, OSSL_LIB_CTX *libctx, const char *propq); + +#endif /* !defined(OSSL_LIBCRYPTO_DSA_DSA_LOCAL_H) */ diff --git a/crypto/dso/dso_local.h b/crypto/dso/dso_local.h index f3ec8021011..8318e3ab0c2 100644 --- a/crypto/dso/dso_local.h +++ b/crypto/dso/dso_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H) +#define OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H + #include #include "internal/cryptlib.h" #include "internal/dso.h" @@ -104,3 +107,5 @@ struct dso_meth_st { /* Perform global symbol lookup, i.e. among *all* modules */ void *(*globallookup)(const char *symname); }; + +#endif /* !defined(OSSL_LIBCRYPTO_DSO_DSO_LOCAL_H) */ diff --git a/crypto/ec/ec_local.h b/crypto/ec/ec_local.h index c6a57530056..16adfbb92ff 100644 --- a/crypto/ec/ec_local.h +++ b/crypto/ec/ec_local.h @@ -8,6 +8,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_EC_EC_LOCAL_H) +#define OSSL_LIBCRYPTO_EC_EC_LOCAL_H + #include #include @@ -794,3 +797,5 @@ static ossl_inline int ec_point_ladder_post(const EC_GROUP *group, return 1; } + +#endif /* !defined(OSSL_LIBCRYPTO_EC_EC_LOCAL_H) */ diff --git a/crypto/ec/ecx_backend.h b/crypto/ec/ecx_backend.h index d3d889c3a57..c549178d9c6 100644 --- a/crypto/ec/ecx_backend.h +++ b/crypto/ec/ecx_backend.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_EC_ECX_BACKEND_H) +#define OSSL_LIBCRYPTO_EC_ECX_BACKEND_H + #define ISX448(id) ((id) == EVP_PKEY_X448) #define IS25519(id) ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519) #define KEYLENID(id) (IS25519(id) ? X25519_KEYLEN \ @@ -18,3 +21,5 @@ : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \ : ECX_KEY_TYPE_ED448)) #define KEYLEN(p) KEYLENID((p)->ameth->pkey_id) + +#endif /* !defined(OSSL_LIBCRYPTO_EC_ECX_BACKEND_H) */ diff --git a/crypto/encode_decode/encoder_local.h b/crypto/encode_decode/encoder_local.h index a35c6174db3..789212746b8 100644 --- a/crypto/encode_decode/encoder_local.h +++ b/crypto/encode_decode/encoder_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H) +#define OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H + #include #include #include @@ -177,3 +180,5 @@ ossl_encoder_parsed_properties(const OSSL_ENCODER *encoder); int ossl_decoder_fast_is_a(OSSL_DECODER *decoder, const char *name, int *id_cache); + +#endif /* !defined(OSSL_LIBCRYPTO_ENCODE_DECODE_ENCODER_LOCAL_H) */ diff --git a/crypto/err/err_local.h b/crypto/err/err_local.h index 4ddf7f7664c..99aa5c76328 100644 --- a/crypto/err/err_local.h +++ b/crypto/err/err_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H) +#define OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H + #include #include #include @@ -115,3 +118,5 @@ static ossl_inline void err_clear(ERR_STATE *es, size_t i, int deall) ERR_STATE *ossl_err_get_state_int(int save_sys_error); void ossl_err_string_int(unsigned long e, const char *func, char *buf, size_t len); + +#endif /* !defined(OSSL_LIBCRYPTO_ERR_ERR_LOCAL_H) */ diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index edc3f9bb1cd..fc00d248405 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H) +#define OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H + #include #include "internal/refcount.h" @@ -390,3 +393,5 @@ int evp_names_do_all(OSSL_PROVIDER *prov, int number, void (*fn)(const char *name, void *data), void *data); int evp_cipher_cache_constants(EVP_CIPHER *cipher); + +#endif /* !defined(OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H) */ diff --git a/crypto/idea/idea_local.h b/crypto/idea/idea_local.h index 73dcd3adbd8..d90d4293e05 100644 --- a/crypto/idea/idea_local.h +++ b/crypto/idea/idea_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H) +#define OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H + #define idea_mul(r, a, b, ul) \ ul = (unsigned long)a * b; \ if (ul != 0) { \ @@ -120,3 +123,5 @@ ul = x2 ^ t0; /* do the swap to x3 */ \ x2 = x3 ^ t1; \ x3 = ul; + +#endif /* !defined(OSSL_LIBCRYPTO_IDEA_IDEA_LOCAL_H) */ diff --git a/crypto/lhash/lhash_local.h b/crypto/lhash/lhash_local.h index 4a7cdfb9f66..c35b3987461 100644 --- a/crypto/lhash/lhash_local.h +++ b/crypto/lhash/lhash_local.h @@ -6,6 +6,9 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H) +#define OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H + #include #include "internal/tsan_assist.h" @@ -33,3 +36,5 @@ struct lhash_st { unsigned long num_items; int error; }; + +#endif /* !defined(OSSL_LIBCRYPTO_LHASH_LHASH_LOCAL_H) */ diff --git a/crypto/md4/md4_local.h b/crypto/md4/md4_local.h index d52914d0c8c..c6ccfb1c789 100644 --- a/crypto/md4/md4_local.h +++ b/crypto/md4/md4_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H) +#define OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H + #include #include #include @@ -71,3 +74,5 @@ void md4_block_data_order(MD4_CTX *c, const void *p, size_t num); a += ((k) + (t) + H((b), (c), (d))); \ a = ROTATE(a, s); \ }; + +#endif /* !defined(OSSL_LIBCRYPTO_MD4_MD4_LOCAL_H) */ diff --git a/crypto/md5/md5_local.h b/crypto/md5/md5_local.h index 090651616ec..581222a7912 100644 --- a/crypto/md5/md5_local.h +++ b/crypto/md5/md5_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H) +#define OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H + #include #include #include @@ -92,3 +95,5 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num); a = ROTATE(a, s); \ a += b; \ }; + +#endif /* !defined(OSSL_LIBCRYPTO_MD5_MD5_LOCAL_H) */ diff --git a/crypto/ml_dsa/ml_dsa_hash.h b/crypto/ml_dsa/ml_dsa_hash.h index 7625d3367d9..1b7ce635160 100644 --- a/crypto/ml_dsa/ml_dsa_hash.h +++ b/crypto/ml_dsa/ml_dsa_hash.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H + #include static ossl_inline ossl_unused int @@ -39,3 +42,5 @@ shake_xof_3(EVP_MD_CTX *ctx, const EVP_MD *md, const uint8_t *in1, size_t in1_le && EVP_DigestUpdate(ctx, in3, in3_len) && EVP_DigestSqueeze(ctx, out, out_len); } + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_HASH_H) */ diff --git a/crypto/ml_dsa/ml_dsa_key.h b/crypto/ml_dsa/ml_dsa_key.h index e89bb01ca44..6defd090fed 100644 --- a/crypto/ml_dsa/ml_dsa_key.h +++ b/crypto/ml_dsa/ml_dsa_key.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H + #include #include "ml_dsa_local.h" #include "ml_dsa_vector.h" @@ -54,3 +57,5 @@ struct ml_dsa_key_st { VECTOR s1; /* private secret of size L with short coefficients (-4..4) or (-2..2) */ /* The s1->poly block is allocated and has space for s2 and t0 also */ }; + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_KEY_H) */ diff --git a/crypto/ml_dsa/ml_dsa_matrix.h b/crypto/ml_dsa/ml_dsa_matrix.h index 0352ecac7af..2610e17dfe8 100644 --- a/crypto/ml_dsa/ml_dsa_matrix.h +++ b/crypto/ml_dsa/ml_dsa_matrix.h @@ -8,6 +8,9 @@ */ /* A 'k' by 'l' Matrix object ('k' rows and 'l' columns) containing polynomial scalars */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H + struct matrix_st { POLY *m_poly; size_t k, l; @@ -42,3 +45,5 @@ matrix_expand_A(EVP_MD_CTX *g_ctx, const EVP_MD *md, const uint8_t *rho, { return ossl_ml_dsa_matrix_expand_A(g_ctx, md, rho, out); } + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_MATRIX_H) */ diff --git a/crypto/ml_dsa/ml_dsa_poly.h b/crypto/ml_dsa/ml_dsa_poly.h index 5edc11be806..3cdb38ea16f 100644 --- a/crypto/ml_dsa/ml_dsa_poly.h +++ b/crypto/ml_dsa/ml_dsa_poly.h @@ -6,6 +6,9 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H + #include #define ML_DSA_NUM_POLY_COEFFICIENTS 256 @@ -182,3 +185,5 @@ poly_max_signed(const POLY *p, uint32_t *mx) *mx = maximum(*mx, abs); } } + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_POLY_H) */ diff --git a/crypto/ml_dsa/ml_dsa_sign.h b/crypto/ml_dsa/ml_dsa_sign.h index 23f44e1702b..be4b2920e01 100644 --- a/crypto/ml_dsa/ml_dsa_sign.h +++ b/crypto/ml_dsa/ml_dsa_sign.h @@ -7,9 +7,14 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H + struct ml_dsa_sig_st { VECTOR z; VECTOR hint; uint8_t *c_tilde; size_t c_tilde_len; }; + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_SIGN_H) */ diff --git a/crypto/ml_dsa/ml_dsa_vector.h b/crypto/ml_dsa/ml_dsa_vector.h index 0693eb6e3c3..6b408acdc20 100644 --- a/crypto/ml_dsa/ml_dsa_vector.h +++ b/crypto/ml_dsa/ml_dsa_vector.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H) +#define OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H + #include #include "ml_dsa_poly.h" @@ -272,3 +275,5 @@ vector_use_hint(const VECTOR *h, const VECTOR *r, uint32_t gamma2, VECTOR *out) for (i = 0; i < out->num_poly; i++) poly_use_hint(h->poly + i, r->poly + i, gamma2, out->poly + i); } + +#endif /* !defined(OSSL_LIBCRYPTO_ML_DSA_ML_DSA_VECTOR_H) */ diff --git a/crypto/objects/obj_local.h b/crypto/objects/obj_local.h index 73848a6fbfe..b17ef9ae090 100644 --- a/crypto/objects/obj_local.h +++ b/crypto/objects/obj_local.h @@ -7,8 +7,13 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H) +#define OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H + typedef struct name_funcs_st NAME_FUNCS; DEFINE_STACK_OF(NAME_FUNCS) DEFINE_LHASH_OF_EX(OBJ_NAME); typedef struct added_obj_st ADDED_OBJ; DEFINE_LHASH_OF_EX(ADDED_OBJ); + +#endif /* !defined(OSSL_LIBCRYPTO_OBJECTS_OBJ_LOCAL_H) */ diff --git a/crypto/ocsp/ocsp_local.h b/crypto/ocsp/ocsp_local.h index 03c5aaef866..2a9e95852a4 100644 --- a/crypto/ocsp/ocsp_local.h +++ b/crypto/ocsp/ocsp_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H) +#define OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H + #include "crypto/x509.h" /* for ossl_x509_add_cert_new() */ /*- CertID ::= SEQUENCE { @@ -244,3 +247,5 @@ struct ocsp_service_locator_st { ASN1_item_verify_ex(ASN1_ITEM_rptr(OCSP_RESPDATA), \ &(a)->signatureAlgorithm, (a)->signature, \ &(a)->tbsResponseData, NULL, r, libctx, propq) + +#endif /* !defined(OSSL_LIBCRYPTO_OCSP_OCSP_LOCAL_H) */ diff --git a/crypto/pem/pem_local.h b/crypto/pem/pem_local.h index ef2874db4ab..840b6acb7f9 100644 --- a/crypto/pem/pem_local.h +++ b/crypto/pem/pem_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H) +#define OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H + #include #include #include @@ -162,3 +165,5 @@ #define IMPLEMENT_PEM_provided_rw_cb(name, TYPE, type, str, asn1) \ IMPLEMENT_PEM_read(name, TYPE, str, asn1) \ IMPLEMENT_PEM_provided_write_cb(name, TYPE, type, str, asn1) + +#endif /* !defined(OSSL_LIBCRYPTO_PEM_PEM_LOCAL_H) */ diff --git a/crypto/pkcs12/p12_local.h b/crypto/pkcs12/p12_local.h index 34ffffb6924..9dce1e14f92 100644 --- a/crypto/pkcs12/p12_local.h +++ b/crypto/pkcs12/p12_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H) +#define OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H + struct PKCS12_MAC_DATA_st { X509_SIG *dinfo; ASN1_OCTET_STRING *salt; @@ -43,3 +46,5 @@ struct pkcs12_bag_st { }; const PKCS7_CTX *ossl_pkcs12_get0_pkcs7ctx(const PKCS12 *p12); + +#endif /* !defined(OSSL_LIBCRYPTO_PKCS12_P12_LOCAL_H) */ diff --git a/crypto/pkcs7/pk7_local.h b/crypto/pkcs7/pk7_local.h index 79f909f3dd8..2155b7b56f2 100644 --- a/crypto/pkcs7/pk7_local.h +++ b/crypto/pkcs7/pk7_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H) +#define OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H + #include "crypto/pkcs7.h" STACK_OF(X509) *pkcs7_get0_certificates(const PKCS7 *p7); @@ -15,3 +18,5 @@ OSSL_LIB_CTX *ossl_pkcs7_ctx_get0_libctx(const PKCS7_CTX *ctx); const char *ossl_pkcs7_ctx_get0_propq(const PKCS7_CTX *ctx); int ossl_pkcs7_ctx_propagate(const PKCS7 *from, PKCS7 *to); + +#endif /* !defined(OSSL_LIBCRYPTO_PKCS7_PK7_LOCAL_H) */ diff --git a/crypto/property/property_local.h b/crypto/property/property_local.h index 98484240bb5..0e63b2b67f4 100644 --- a/crypto/property/property_local.h +++ b/crypto/property/property_local.h @@ -8,6 +8,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H) +#define OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H + #include #include "internal/property.h" @@ -55,3 +58,5 @@ int ossl_property_has_optional(const OSSL_PROPERTY_LIST *query); OSSL_PROPERTY_LIST *ossl_prop_defn_get(OSSL_LIB_CTX *ctx, const char *prop); int ossl_prop_defn_set(OSSL_LIB_CTX *ctx, const char *prop, OSSL_PROPERTY_LIST **pl); + +#endif /* !defined(OSSL_LIBCRYPTO_PROPERTY_PROPERTY_LOCAL_H) */ diff --git a/crypto/provider_local.h b/crypto/provider_local.h index 7799980808f..a7c830ab511 100644 --- a/crypto/provider_local.h +++ b/crypto/provider_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_PROVIDER_LOCAL_H) +#define OSSL_LIBCRYPTO_PROVIDER_LOCAL_H + #include typedef struct { @@ -31,3 +34,5 @@ int ossl_provider_info_add_to_store(OSSL_LIB_CTX *libctx, int ossl_provider_info_add_parameter(OSSL_PROVIDER_INFO *provinfo, const char *name, const char *value); + +#endif /* !defined(OSSL_LIBCRYPTO_PROVIDER_LOCAL_H) */ diff --git a/crypto/rc2/rc2_local.h b/crypto/rc2/rc2_local.h index f4bd06aaa66..c4b85695140 100644 --- a/crypto/rc2/rc2_local.h +++ b/crypto/rc2/rc2_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H) +#define OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H + #undef c2l #define c2l(c, l) (l = ((unsigned long)(*((c)++))), \ l |= ((unsigned long)(*((c)++))) << 8L, \ @@ -83,3 +86,5 @@ *(--(c)) = (unsigned char)(((l1)) & 0xff); \ } \ } + +#endif /* !defined(OSSL_LIBCRYPTO_RC2_RC2_LOCAL_H) */ diff --git a/crypto/rc5/rc5_local.h b/crypto/rc5/rc5_local.h index 57a1642c97e..7b29c9b853b 100644 --- a/crypto/rc5/rc5_local.h +++ b/crypto/rc5/rc5_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H) +#define OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H + #include #undef c2l @@ -143,3 +146,5 @@ a &= RC5_32_MASK; \ a = ROTATE_r32(a, b); \ a ^= b; + +#endif /* !defined(OSSL_LIBCRYPTO_RC5_RC5_LOCAL_H) */ diff --git a/crypto/ripemd/rmd_local.h b/crypto/ripemd/rmd_local.h index 2e47ede12a3..a1dd4802826 100644 --- a/crypto/ripemd/rmd_local.h +++ b/crypto/ripemd/rmd_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H) +#define OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H + #include #include #include @@ -103,3 +106,5 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num); a = ROTATE(a, s) + e; \ c = ROTATE(c, 10); \ } + +#endif /* !defined(OSSL_LIBCRYPTO_RIPEMD_RMD_LOCAL_H) */ diff --git a/crypto/ripemd/rmdconst.h b/crypto/ripemd/rmdconst.h index f9daf1b09f2..bb48abe49ad 100644 --- a/crypto/ripemd/rmdconst.h +++ b/crypto/ripemd/rmdconst.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H) +#define OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H + #define KL0 0x00000000L #define KL1 0x5A827999L #define KL2 0x6ED9EBA1L @@ -348,3 +351,5 @@ #define SR78 11 #define WR79 11 #define SR79 11 + +#endif /* !defined(OSSL_LIBCRYPTO_RIPEMD_RMDCONST_H) */ diff --git a/crypto/sha/sha_local.h b/crypto/sha/sha_local.h index 61693e94344..afe6df66d46 100644 --- a/crypto/sha/sha_local.h +++ b/crypto/sha/sha_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H) +#define OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H + #include #include @@ -440,3 +443,5 @@ static void HASH_BLOCK_DATA_ORDER(SHA_CTX *c, const void *p, size_t num) #endif #endif + +#endif /* !defined(OSSL_LIBCRYPTO_SHA_SHA_LOCAL_H) */ diff --git a/crypto/slh_dsa/slh_adrs.h b/crypto/slh_dsa/slh_adrs.h index 556d0ad2863..f07d7e8b559 100644 --- a/crypto/slh_dsa/slh_adrs.h +++ b/crypto/slh_dsa/slh_adrs.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H) +#define OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H + #include /* @@ -69,3 +72,5 @@ typedef struct slh_adrs_func_st { } SLH_ADRS_FUNC; const SLH_ADRS_FUNC *ossl_slh_get_adrs_fn(int is_compressed); + +#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_ADRS_H) */ diff --git a/crypto/slh_dsa/slh_dsa_key.h b/crypto/slh_dsa/slh_dsa_key.h index eb6d32327e9..412bffdeea1 100644 --- a/crypto/slh_dsa/slh_dsa_key.h +++ b/crypto/slh_dsa/slh_dsa_key.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H) +#define OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H + #include #define SLH_DSA_MAX_N 32 @@ -48,3 +51,5 @@ struct slh_dsa_key_st { EVP_MD *md_sha512; /* Used for SHA-512 hashes */ EVP_MAC *hmac; }; + +#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_KEY_H) */ diff --git a/crypto/slh_dsa/slh_dsa_local.h b/crypto/slh_dsa/slh_dsa_local.h index e5b48167b81..f11bf097cdb 100644 --- a/crypto/slh_dsa/slh_dsa_local.h +++ b/crypto/slh_dsa/slh_dsa_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H) +#define OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H + #include "crypto/slh_dsa.h" #include "slh_hash.h" #include "slh_params.h" @@ -93,3 +96,5 @@ __owur int ossl_slh_fors_pk_from_sig(SLH_DSA_HASH_CTX *ctx, PACKET *sig_rpkt, const uint8_t *md, const uint8_t *pk_seed, uint8_t *adrs, uint8_t *pk_out, size_t pk_out_len); + +#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_DSA_LOCAL_H) */ diff --git a/crypto/slh_dsa/slh_params.h b/crypto/slh_dsa/slh_params.h index fea14d5d6a8..edc3644b61f 100644 --- a/crypto/slh_dsa/slh_params.h +++ b/crypto/slh_dsa/slh_params.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H) +#define OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H + #include /* @@ -37,3 +40,5 @@ typedef struct slh_dsa_params_st { } SLH_DSA_PARAMS; const SLH_DSA_PARAMS *ossl_slh_dsa_params_get(const char *alg); + +#endif /* !defined(OSSL_LIBCRYPTO_SLH_DSA_SLH_PARAMS_H) */ diff --git a/crypto/sm3/sm3_local.h b/crypto/sm3/sm3_local.h index 722dc9acecd..a8f92be87e5 100644 --- a/crypto/sm3/sm3_local.h +++ b/crypto/sm3/sm3_local.h @@ -9,6 +9,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H) +#define OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H + #include #include "internal/cryptlib.h" #include "internal/sm3.h" @@ -131,3 +134,5 @@ void ossl_sm3_transform(SM3_CTX *c, const unsigned char *data); #define SM3_F 0x163138aaUL #define SM3_G 0xe38dee4dUL #define SM3_H 0xb0fb0e4eUL + +#endif /* !defined(OSSL_LIBCRYPTO_SM3_SM3_LOCAL_H) */ diff --git a/crypto/store/store_local.h b/crypto/store/store_local.h index d5020e01a4b..f668d4bbbc3 100644 --- a/crypto/store/store_local.h +++ b/crypto/store/store_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H) +#define OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H + #include #include "internal/thread_once.h" #include "internal/refcount.h" @@ -175,3 +178,5 @@ struct ossl_load_result_data_st { OSSL_STORE_CTX *ctx; }; OSSL_CALLBACK ossl_store_handle_load_result; + +#endif /* !defined(OSSL_LIBCRYPTO_STORE_STORE_LOCAL_H) */ diff --git a/crypto/ts/ts_local.h b/crypto/ts/ts_local.h index 7aebad0948e..d86b395472b 100644 --- a/crypto/ts/ts_local.h +++ b/crypto/ts/ts_local.h @@ -12,6 +12,9 @@ * hashAlgorithm AlgorithmIdentifier, * hashedMessage OCTET STRING } */ +#if !defined(OSSL_LIBCRYPTO_TS_TS_LOCAL_H) +#define OSSL_LIBCRYPTO_TS_TS_LOCAL_H + struct TS_msg_imprint_st { X509_ALGOR *hash_algo; ASN1_OCTET_STRING *hashed_msg; @@ -150,3 +153,5 @@ struct TS_verify_ctx { /* Must be set only with TS_VFY_TSA_NAME. */ GENERAL_NAME *tsa_name; }; + +#endif /* !defined(OSSL_LIBCRYPTO_TS_TS_LOCAL_H) */ diff --git a/crypto/vms_rms.h b/crypto/vms_rms.h index fed6cd0fc33..3c3c98ea13d 100644 --- a/crypto/vms_rms.h +++ b/crypto/vms_rms.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_VMS_RMS_H) +#define OSSL_LIBCRYPTO_VMS_RMS_H + #ifdef NAML$C_MAXRSS #define CC_RMS_NAMX cc$rms_naml @@ -58,3 +61,5 @@ #endif /* def NAM$M_NO_SHORT_UPCASE [else] */ #endif /* def NAML$C_MAXRSS [else] */ + +#endif /* !defined(OSSL_LIBCRYPTO_VMS_RMS_H) */ diff --git a/crypto/whrlpool/wp_local.h b/crypto/whrlpool/wp_local.h index 73dc2a003da..8e7c8b52ec1 100644 --- a/crypto/whrlpool/wp_local.h +++ b/crypto/whrlpool/wp_local.h @@ -7,6 +7,11 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H) +#define OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H + #include void whirlpool_block(WHIRLPOOL_CTX *, const void *, size_t); + +#endif /* !defined(OSSL_LIBCRYPTO_WHRLPOOL_WP_LOCAL_H) */ diff --git a/crypto/x509/ext_dat.h b/crypto/x509/ext_dat.h index 5d4c2fdb86c..bec7716135d 100644 --- a/crypto/x509/ext_dat.h +++ b/crypto/x509/ext_dat.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_X509_EXT_DAT_H) +#define OSSL_LIBCRYPTO_X509_EXT_DAT_H + int ossl_v3_name_cmp(const char *name, const char *cmp); extern const X509V3_EXT_METHOD ossl_v3_bcons, ossl_v3_nscert, ossl_v3_key_usage, ossl_v3_ext_ku; @@ -49,3 +52,5 @@ extern const X509V3_EXT_METHOD ossl_v3_time_specification; extern const X509V3_EXT_METHOD ossl_v3_attribute_mappings; extern const X509V3_EXT_METHOD ossl_v3_allowed_attribute_assignments; extern const X509V3_EXT_METHOD ossl_v3_aa_issuing_dist_point; + +#endif /* !defined(OSSL_LIBCRYPTO_X509_EXT_DAT_H) */ diff --git a/crypto/x509/pcy_local.h b/crypto/x509/pcy_local.h index 957ea59723b..56466ea07f5 100644 --- a/crypto/x509/pcy_local.h +++ b/crypto/x509/pcy_local.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_X509_PCY_LOCAL_H) +#define OSSL_LIBCRYPTO_X509_PCY_LOCAL_H + typedef struct X509_POLICY_DATA_st X509_POLICY_DATA; DEFINE_STACK_OF(X509_POLICY_DATA) @@ -169,3 +172,5 @@ int ossl_policy_node_match(const X509_POLICY_LEVEL *lvl, const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); const X509_POLICY_CACHE *ossl_policy_cache_set(X509 *x); + +#endif /* !defined(OSSL_LIBCRYPTO_X509_PCY_LOCAL_H) */ diff --git a/crypto/x509/standard_exts.h b/crypto/x509/standard_exts.h index 46bda55558f..14e6455ae14 100644 --- a/crypto/x509/standard_exts.h +++ b/crypto/x509/standard_exts.h @@ -12,6 +12,9 @@ * of the ext_nid values. */ +#if !defined(OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H) +#define OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H + static const X509V3_EXT_METHOD *const standard_exts[] = { &ossl_v3_nscert, &ossl_v3_ns_ia5_list[0], @@ -97,3 +100,5 @@ static const X509V3_EXT_METHOD *const standard_exts[] = { /* Number of standard extensions */ #define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts) + +#endif /* !defined(OSSL_LIBCRYPTO_X509_STANDARD_EXTS_H) */ diff --git a/crypto/x509/x509_local.h b/crypto/x509/x509_local.h index 76c3a897f95..a3433336ca0 100644 --- a/crypto/x509/x509_local.h +++ b/crypto/x509/x509_local.h @@ -6,6 +6,9 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_X509_X509_LOCAL_H) +#define OSSL_LIBCRYPTO_X509_X509_LOCAL_H + #include #include @@ -195,3 +198,5 @@ int ossl_x509_check_rfc822(X509 *x, const char *chk, size_t chklen, unsigned int flags); int ossl_x509_check_smtputf8(X509 *x, const char *chk, size_t chklen, unsigned int flags); + +#endif /* !defined(OSSL_LIBCRYPTO_X509_X509_LOCAL_H) */