From: Bob Beck Date: Wed, 3 Sep 2025 00:54:49 +0000 (-0600) Subject: make includes self-contained X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5277a4b1d6d682072bbe7d134fbae2338329eb;p=thirdparty%2Fopenssl.git make includes self-contained Reviewed-by: Tomas Mraz Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs MergeDate: Wed May 6 11:35:48 2026 (Merged from https://github.com/openssl/openssl/pull/31001) --- diff --git a/include/crypto/bn_dh.h b/include/crypto/bn_dh.h index fdb170ab3ff..89175dfac29 100644 --- a/include/crypto/bn_dh.h +++ b/include/crypto/bn_dh.h @@ -10,6 +10,8 @@ #if !defined(OSSL_CRYPTO_BN_DH_H) #define OSSL_CRYPTO_BN_DH_H +#include + #define declare_dh_bn(x) \ extern const BIGNUM ossl_bignum_dh##x##_p; \ extern const BIGNUM ossl_bignum_dh##x##_q; \ diff --git a/include/crypto/bn_srp.h b/include/crypto/bn_srp.h index 00b160aad12..7e3dade0bd7 100644 --- a/include/crypto/bn_srp.h +++ b/include/crypto/bn_srp.h @@ -6,9 +6,13 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#if !defined(OPENSSL_CRYPTO_BN_SRP_H) +#define OPENSSL_CRYPTO_BN_SRP_H #ifndef OPENSSL_NO_SRP +#include + extern const BIGNUM ossl_bn_group_1024; extern const BIGNUM ossl_bn_group_1536; @@ -30,3 +34,4 @@ extern const BIGNUM ossl_bn_generator_5; extern const BIGNUM ossl_bn_generator_2; #endif +#endif /* !defined(OPENSSL_CRYPTO_BN_SRP_H) */ diff --git a/include/crypto/ess.h b/include/crypto/ess.h index c29752117e4..cc5bb7febcc 100644 --- a/include/crypto/ess.h +++ b/include/crypto/ess.h @@ -11,6 +11,10 @@ #define OSSL_CRYPTO_ESS_H #pragma once +#include +#include +#include + /*- * IssuerSerial ::= SEQUENCE { * issuer GeneralNames, diff --git a/include/crypto/lms_util.h b/include/crypto/lms_util.h index 0f4f4e61432..54aa51e17a7 100644 --- a/include/crypto/lms_util.h +++ b/include/crypto/lms_util.h @@ -17,6 +17,8 @@ #include #include +#include "crypto/lms.h" + /* * This LMS implementation assumes that the hash algorithm must be the same for * LMS params and OTS params. Since OpenSSL does not have a "SHAKE256-192" diff --git a/include/crypto/pkcs7.h b/include/crypto/pkcs7.h index bf0e6bf6074..8d999fd44f8 100644 --- a/include/crypto/pkcs7.h +++ b/include/crypto/pkcs7.h @@ -11,6 +11,8 @@ #define OSSL_CRYPTO_PKCS7_H #pragma once +#include + void ossl_pkcs7_resolve_libctx(PKCS7 *p7); void ossl_pkcs7_set0_libctx(PKCS7 *p7, OSSL_LIB_CTX *ctx); diff --git a/include/crypto/security_bits.h b/include/crypto/security_bits.h index 56fe8d2573d..8b42338a4dc 100644 --- a/include/crypto/security_bits.h +++ b/include/crypto/security_bits.h @@ -11,6 +11,8 @@ #define OSSL_SECURITY_BITS_H #pragma once +#include + uint16_t ossl_ifc_ffc_compute_security_bits(int n); #endif diff --git a/include/crypto/siphash.h b/include/crypto/siphash.h index 3ffdc055e69..cb2f6de68fa 100644 --- a/include/crypto/siphash.h +++ b/include/crypto/siphash.h @@ -12,6 +12,7 @@ #pragma once #include +#include #define SIPHASH_BLOCK_SIZE 8 #define SIPHASH_KEY_SIZE 16 diff --git a/include/crypto/siv.h b/include/crypto/siv.h index b4f04a80c8a..d842baae494 100644 --- a/include/crypto/siv.h +++ b/include/crypto/siv.h @@ -6,9 +6,15 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +#if !defined(OPENSSL_CRYPTO_SIV_H) +#define OPENSSL_CRYPTO_SIV_H #ifndef OPENSSL_NO_SIV +#include + +#include + typedef struct siv128_context SIV128_CONTEXT; SIV128_CONTEXT *ossl_siv128_new(const unsigned char *key, int klen, @@ -31,3 +37,4 @@ int ossl_siv128_cleanup(SIV128_CONTEXT *ctx); int ossl_siv128_speed(SIV128_CONTEXT *ctx, int arg); #endif /* OPENSSL_NO_SIV */ +#endif /* !defined (OPENSSL_CRYPTO_SIV_H) */ diff --git a/include/internal/core.h b/include/internal/core.h index 98fc4681d84..5c9ffc657bd 100644 --- a/include/internal/core.h +++ b/include/internal/core.h @@ -12,6 +12,7 @@ #pragma once #include +#include /* * namespaces: diff --git a/include/internal/dane.h b/include/internal/dane.h index 9c040eedc68..8df761facfb 100644 --- a/include/internal/dane.h +++ b/include/internal/dane.h @@ -11,6 +11,7 @@ #define OSSL_INTERNAL_DANE_H #pragma once +#include #include /*- diff --git a/include/internal/ech_helpers.h b/include/internal/ech_helpers.h index 6e7a7e29ff8..00053eed6a7 100644 --- a/include/internal/ech_helpers.h +++ b/include/internal/ech_helpers.h @@ -15,6 +15,9 @@ #define OPENSSL_ECH_HELPERS_H #pragma once +#include +#include + #ifndef OPENSSL_NO_ECH /* diff --git a/include/internal/hashtable.h b/include/internal/hashtable.h index 56a8b8254cd..7c4150ba288 100644 --- a/include/internal/hashtable.h +++ b/include/internal/hashtable.h @@ -13,6 +13,7 @@ #include #include +#include #include #include #include "crypto/context.h" diff --git a/include/internal/hpke_util.h b/include/internal/hpke_util.h index 9c52ba46938..152c3213edf 100644 --- a/include/internal/hpke_util.h +++ b/include/internal/hpke_util.h @@ -11,6 +11,11 @@ #define OSSL_INTERNAL_HPKE_UTIL_H #pragma once +#include + +#include +#include + /* Constants from RFC 9180 Section 7.1 and 7.3 */ #define OSSL_HPKE_MAX_SECRET 64 #define OSSL_HPKE_MAX_PUBLIC 133 diff --git a/include/internal/passphrase.h b/include/internal/passphrase.h index 803622867b7..b7cbaa1057a 100644 --- a/include/internal/passphrase.h +++ b/include/internal/passphrase.h @@ -11,6 +11,8 @@ #define OSSL_INTERNAL_PASSPHRASE_H #pragma once +#include + /* * This is a passphrase reader bridge with bells and whistles. * diff --git a/include/internal/qlog.h b/include/internal/qlog.h index eb68570e608..ecabe942f2e 100644 --- a/include/internal/qlog.h +++ b/include/internal/qlog.h @@ -21,10 +21,11 @@ typedef struct qlog_st QLOG; enum { QLOG_EVENT_TYPE_NONE, - +/* clang-format off */ #define QLOG_EVENT(cat, name) QLOG_EVENT_TYPE_##cat##_##name, -#include "internal/qlog_events.h" +#include "internal/qlog_events.inc" #undef QLOG_EVENT + /* clang-format on */ QLOG_EVENT_TYPE_NUM }; diff --git a/include/internal/quic_thread_assist.h b/include/internal/quic_thread_assist.h index fbfac146dab..152c84663da 100644 --- a/include/internal/quic_thread_assist.h +++ b/include/internal/quic_thread_assist.h @@ -11,6 +11,8 @@ #define OSSL_QUIC_THREAD_ASSIST_H #include + +#include "internal/quic_channel.h" #include "internal/thread.h" #include "internal/time.h" diff --git a/include/internal/quic_trace.h b/include/internal/quic_trace.h index f462ce0c009..bddb9823c23 100644 --- a/include/internal/quic_trace.h +++ b/include/internal/quic_trace.h @@ -12,6 +12,10 @@ #ifndef OPENSSL_NO_QUIC +#include + +#include + int ossl_quic_trace(int write_p, int version, int content_type, const void *buf, size_t msglen, SSL *ssl, void *arg); diff --git a/include/internal/ring_buf.h b/include/internal/ring_buf.h index cc70bfaeac9..19c13817fd4 100644 --- a/include/internal/ring_buf.h +++ b/include/internal/ring_buf.h @@ -11,7 +11,12 @@ #define OSSL_INTERNAL_RING_BUF_H #pragma once +#include +#include + #include /* For 'ossl_inline' */ +#include + #include "internal/safe_math.h" /* diff --git a/include/internal/skey.h b/include/internal/skey.h index a4b6c6e6a9e..b511af8c32c 100644 --- a/include/internal/skey.h +++ b/include/internal/skey.h @@ -10,6 +10,10 @@ #ifndef OSSL_CRYPTO_SKEY_H #define OSSL_CRYPTO_SKEY_H +#include + +#include + /* Known symmetric key type definitions */ #define SKEY_TYPE_GENERIC 1 /* generic bytes container unknown key types */ #define SKEY_TYPE_AES 2 /* AES keys */ diff --git a/include/internal/sm3.h b/include/internal/sm3.h index ee097d85e6d..0faf5449426 100644 --- a/include/internal/sm3.h +++ b/include/internal/sm3.h @@ -13,6 +13,8 @@ #define OSSL_INTERNAL_SM3_H #pragma once +#include + #include #ifdef OPENSSL_NO_SM3 diff --git a/include/internal/sslconf.h b/include/internal/sslconf.h index 49da9230592..a016613a57b 100644 --- a/include/internal/sslconf.h +++ b/include/internal/sslconf.h @@ -11,6 +11,10 @@ #define OSSL_INTERNAL_SSLCONF_H #pragma once +#include + +#include + typedef struct ssl_conf_cmd_st SSL_CONF_CMD; /* diff --git a/include/internal/statem.h b/include/internal/statem.h index 3a6a63238c9..990100c4dc0 100644 --- a/include/internal/statem.h +++ b/include/internal/statem.h @@ -9,6 +9,11 @@ #ifndef OSSL_INTERNAL_STATEM_H #define OSSL_INTERNAL_STATEM_H +#include + +#include +#include + /***************************************************************************** * * * These enums should be considered PRIVATE to the state machine. No * diff --git a/include/internal/threads_common.h b/include/internal/threads_common.h index cf549148663..1f54eadf829 100644 --- a/include/internal/threads_common.h +++ b/include/internal/threads_common.h @@ -10,6 +10,8 @@ #ifndef _CRYPTO_THREADS_COMMON_H_ #define _CRYPTO_THREADS_COMMON_H_ +#include + #if defined(__clang__) && defined(__has_feature) #if __has_feature(thread_sanitizer) #define __SANITIZE_THREAD__ diff --git a/include/internal/tlsgroups.h b/include/internal/tlsgroups.h index c702471f6cb..f12e142b9a4 100644 --- a/include/internal/tlsgroups.h +++ b/include/internal/tlsgroups.h @@ -11,6 +11,10 @@ #define OSSL_INTERNAL_TLSGROUPS_H #pragma once +#include + +#include /* For 'ossl_inline' */ + #define OSSL_TLS_GROUP_ID_sect163k1 0x0001 #define OSSL_TLS_GROUP_ID_sect163r1 0x0002 #define OSSL_TLS_GROUP_ID_sect163r2 0x0003 diff --git a/include/internal/to_hex.h b/include/internal/to_hex.h index 36f4671c66b..4b3940800f8 100644 --- a/include/internal/to_hex.h +++ b/include/internal/to_hex.h @@ -11,6 +11,8 @@ #define OSSL_INTERNAL_TO_HEX_H #pragma once +#include + static ossl_inline size_t to_hex(char *buf, uint8_t n, const char hexdig[17]) { *buf++ = hexdig[(n >> 4) & 0xf]; diff --git a/include/internal/unicode.h b/include/internal/unicode.h index 4ef53cd69c2..d1dae6d2453 100644 --- a/include/internal/unicode.h +++ b/include/internal/unicode.h @@ -11,6 +11,8 @@ #define OSSL_INTERNAL_UNICODE_H #pragma once +#include + typedef enum { SURROGATE_MIN = 0xd800UL, SURROGATE_MAX = 0xdfffUL,