Commit 7852ae70c7 for openssl.org
commit 7852ae70c79f999e027fee85c459f8cf3a56433e
Author: Bob Beck <beck@openssl.org>
Date: Tue Sep 2 18:52:16 2025 -0600
md32_common.h is not a self contained header file
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
MergeDate: Wed May 6 11:35:44 2026
(Merged from https://github.com/openssl/openssl/pull/31001)
diff --git a/crypto/md4/md4_local.h b/crypto/md4/md4_local.h
index ec2a8c361c..d52914d0c8 100644
--- a/crypto/md4/md4_local.h
+++ b/crypto/md4/md4_local.h
@@ -36,7 +36,9 @@ void md4_block_data_order(MD4_CTX *c, const void *p, size_t num);
} while (0)
#define HASH_BLOCK_DATA_ORDER md4_block_data_order
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
/*-
#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
diff --git a/crypto/md5/md5_local.h b/crypto/md5/md5_local.h
index 7af5254457..090651616e 100644
--- a/crypto/md5/md5_local.h
+++ b/crypto/md5/md5_local.h
@@ -46,7 +46,9 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num);
} while (0)
#define HASH_BLOCK_DATA_ORDER md5_block_data_order
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
/*-
#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
diff --git a/crypto/ripemd/rmd_local.h b/crypto/ripemd/rmd_local.h
index f2934a7332..2e47ede12a 100644
--- a/crypto/ripemd/rmd_local.h
+++ b/crypto/ripemd/rmd_local.h
@@ -48,7 +48,9 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num);
} while (0)
#define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
/*
* Transformed F2 and F4 are courtesy of Wei Dai
diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c
index e8f1ef5244..3fe0aebfff 100644
--- a/crypto/sha/sha1dgst.c
+++ b/crypto/sha/sha1dgst.c
@@ -20,7 +20,7 @@
#include <openssl/evp.h>
#include <openssl/sha.h>
-/* The implementation is in crypto/md32_common.h */
+/* The implementation is in crypto/md32_common.inc */
#include "sha_local.h"
#include "crypto/sha.h"
diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c
index d624d39d21..eab9487622 100644
--- a/crypto/sha/sha256.c
+++ b/crypto/sha/sha256.c
@@ -133,7 +133,9 @@ void sha256_block_data_order_c(SHA256_CTX *ctx, const void *in, size_t num);
#endif /* SHA256_ASM */
void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num);
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
#undef HASH_UPDATE_THUNK
int SHA256_Update(SHA256_CTX *ctx, const void *data, size_t sz)
diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c
index 7e04607282..6ccc0070e0 100644
--- a/crypto/sha/sha512.c
+++ b/crypto/sha/sha512.c
@@ -26,7 +26,7 @@
* on [aligned] data in host byte order, and one operating on data in input
* stream byte order;
* - share common byte-order neutral collector and padding function
- * implementations, crypto/md32_common.h;
+ * implementations, crypto/md32_common.inc;
*
* Neither of the above applies to this SHA-512 implementation. Reasons
* [in reverse order] are:
diff --git a/crypto/sha/sha_local.h b/crypto/sha/sha_local.h
index d74d49a4b7..61693e9434 100644
--- a/crypto/sha/sha_local.h
+++ b/crypto/sha/sha_local.h
@@ -49,7 +49,9 @@ static void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
#endif
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
#undef HASH_UPDATE_THUNK
int SHA1_Update(SHA_CTX *c, const void *data, size_t len)
diff --git a/crypto/sm3/sm3_local.h b/crypto/sm3/sm3_local.h
index d6c9a96710..722dc9acec 100644
--- a/crypto/sm3/sm3_local.h
+++ b/crypto/sm3/sm3_local.h
@@ -69,7 +69,9 @@ void ossl_hwsm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
void ossl_sm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
void ossl_sm3_transform(SM3_CTX *c, const unsigned char *data);
-#include "crypto/md32_common.h"
+/* clang-format off */
+#include "crypto/md32_common.inc"
+/* clang-format on */
#ifndef PEDANTIC
#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
diff --git a/include/crypto/md32_common.h b/include/crypto/md32_common.inc
similarity index 100%
rename from include/crypto/md32_common.h
rename to include/crypto/md32_common.inc
diff --git a/providers/fips-sources.checksums b/providers/fips-sources.checksums
index 3cc2561067..527e124d76 100644
--- a/providers/fips-sources.checksums
+++ b/providers/fips-sources.checksums
@@ -453,7 +453,7 @@ fb109231b7f7fc2e83dd39ec6ef14d88f6ee60cc91ef1efd0c49fa7eeaa50ace include/crypto
8eef8896afdccc8c90c548e0d11b290c004df3231a1777e8205b88c04645c4b5 include/crypto/ecx.h
4af06cb0219605fdbb606b0b6de51e34aa0503b42457a424f80c7c0c39dcc985 include/crypto/evp.h
fc22d8a6d80875c8c45c51a449069b936eadb9621aa9c0bcc8c5d493eed1e52c include/crypto/lhash.h
-0651a33eb67395c48ca64650dc2912326b7c0b7b47832e0c59bc4139e7f271c6 include/crypto/md32_common.h
+0651a33eb67395c48ca64650dc2912326b7c0b7b47832e0c59bc4139e7f271c6 include/crypto/md32_common.inc
47a92e596adaf252ed86d3c363e1b7d1893445aaef302eb50cf18473c3c08541 include/crypto/ml_dsa.h
60b558f2990b9f390dee864dbd15372a98dc2dd95c4701c088a5a804198e7421 include/crypto/ml_kem.h
b7a00f7e37fb4054d371438f270e67eb584eacb9b13fe29536dac90e8371436d include/crypto/modes.h
diff --git a/providers/fips.module.sources b/providers/fips.module.sources
index 1b18cd626b..f9a12d7105 100644
--- a/providers/fips.module.sources
+++ b/providers/fips.module.sources
@@ -453,7 +453,7 @@ include/crypto/ec.h
include/crypto/ecx.h
include/crypto/evp.h
include/crypto/lhash.h
-include/crypto/md32_common.h
+include/crypto/md32_common.inc
include/crypto/ml_dsa.h
include/crypto/ml_kem.h
include/crypto/modes.h
diff --git a/util/fix-includes.sed b/util/fix-includes.sed
index 16c723bf73..60b64ed69c 100644
--- a/util/fix-includes.sed
+++ b/util/fix-includes.sed
@@ -1,5 +1,5 @@
s|internal/([a-z0-9_]+)_int\.h|crypto/\1.h|g ;
-s@internal/(aria.h|asn1_dsa.h|async.h|bn_dh.h|bn_srp.h|chacha.h|(aes|des|cmll)_platform.h|ctype.h|__DECC_INCLUDE_EPILOGUE.H|__DECC_INCLUDE_PROLOGUE.H|dso_conf.h|dso_conf.h|lhash.h|md32_common.h|objects.h|poly1305.h|sha.h|siphash.h|sm2err.h|sm2.h|sm4.h|sparse_array.h|store.h|foobar)@crypto/\1@g ;
+s@internal/(aria.h|asn1_dsa.h|async.h|bn_dh.h|bn_srp.h|chacha.h|(aes|des|cmll)_platform.h|ctype.h|__DECC_INCLUDE_EPILOGUE.H|__DECC_INCLUDE_PROLOGUE.H|dso_conf.h|dso_conf.h|lhash.h|objects.h|poly1305.h|sha.h|siphash.h|sm2err.h|sm2.h|sm4.h|sparse_array.h|store.h|foobar)@crypto/\1@g ;
s/constant_time_locl/constant_time/g ;
s/_lo?cl\.h/_local.h/g ;
s/_int\.h/_local.h/g ;