Commit 2b91fd900f for openssl.org

commit 2b91fd900f46396ae95c624c3404fbae4adc6109
Author: Matt Caswell <matt@openssl.org>
Date:   Wed Jan 7 11:54:05 2026 +0000

    Clean up some unnecessary inclusions

    After the deadcode removal there were varios include files being used
    that are no longer necessary. We remove them.

    Reviewed-by: Tomas Mraz <tomas@openssl.org>
    Reviewed-by: Paul Dale <paul.dale@oracle.com>
    Reviewed-by: Neil Horman <nhorman@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/29460)

diff --git a/crypto/evp/legacy_blake2.c b/crypto/evp/legacy_blake2.c
index 317cc9c95f..b7018c8277 100644
--- a/crypto/evp/legacy_blake2.c
+++ b/crypto/evp/legacy_blake2.c
@@ -9,7 +9,6 @@

 #include "crypto/evp.h"
 #include "prov/blake2.h" /* diverse BLAKE2 macros */
-#include "legacy_meth.h"

 static const EVP_MD blake2b_md = {
     NID_blake2b512,
diff --git a/crypto/evp/legacy_md2.c b/crypto/evp/legacy_md2.c
index 2fe3341adf..605f8a5b44 100644
--- a/crypto/evp/legacy_md2.c
+++ b/crypto/evp/legacy_md2.c
@@ -9,7 +9,6 @@

 #include <openssl/md2.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD md2_md = {
     NID_md2,
diff --git a/crypto/evp/legacy_md4.c b/crypto/evp/legacy_md4.c
index 6d12ebdeec..fcfe3662e4 100644
--- a/crypto/evp/legacy_md4.c
+++ b/crypto/evp/legacy_md4.c
@@ -15,7 +15,6 @@

 #include <openssl/md4.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD md4_md = {
     NID_md4,
diff --git a/crypto/evp/legacy_md5.c b/crypto/evp/legacy_md5.c
index cc33f05795..bb84cea6b0 100644
--- a/crypto/evp/legacy_md5.c
+++ b/crypto/evp/legacy_md5.c
@@ -15,7 +15,6 @@

 #include <openssl/md5.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD md5_md = {
     NID_md5,
diff --git a/crypto/evp/legacy_md5_sha1.c b/crypto/evp/legacy_md5_sha1.c
index 5e6cf85bf1..eb81dc5c41 100644
--- a/crypto/evp/legacy_md5_sha1.c
+++ b/crypto/evp/legacy_md5_sha1.c
@@ -16,7 +16,6 @@

 #include "crypto/evp.h"
 #include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
-#include "legacy_meth.h"

 static const EVP_MD md5_sha1_md = {
     NID_md5_sha1,
diff --git a/crypto/evp/legacy_mdc2.c b/crypto/evp/legacy_mdc2.c
index ef940558e5..af47c46f6f 100644
--- a/crypto/evp/legacy_mdc2.c
+++ b/crypto/evp/legacy_mdc2.c
@@ -15,7 +15,6 @@

 #include <openssl/mdc2.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD mdc2_md = {
     NID_mdc2,
diff --git a/crypto/evp/legacy_meth.h b/crypto/evp/legacy_meth.h
deleted file mode 100644
index 01d80e3701..0000000000
--- a/crypto/evp/legacy_meth.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#define IMPLEMENT_LEGACY_EVP_MD_METH(nm, fn)                                \
-    static int nm##_init(EVP_MD_CTX *ctx)                                   \
-    {                                                                       \
-        return fn##_Init(EVP_MD_CTX_get0_md_data(ctx));                     \
-    }                                                                       \
-    static int nm##_update(EVP_MD_CTX *ctx, const void *data, size_t count) \
-    {                                                                       \
-        return fn##_Update(EVP_MD_CTX_get0_md_data(ctx), data, count);      \
-    }                                                                       \
-    static int nm##_final(EVP_MD_CTX *ctx, unsigned char *md)               \
-    {                                                                       \
-        return fn##_Final(md, EVP_MD_CTX_get0_md_data(ctx));                \
-    }
-
-#define IMPLEMENT_LEGACY_EVP_MD_METH_LC(nm, fn)                             \
-    static int nm##_init(EVP_MD_CTX *ctx)                                   \
-    {                                                                       \
-        return fn##_init(EVP_MD_CTX_get0_md_data(ctx));                     \
-    }                                                                       \
-    static int nm##_update(EVP_MD_CTX *ctx, const void *data, size_t count) \
-    {                                                                       \
-        return fn##_update(EVP_MD_CTX_get0_md_data(ctx), data, count);      \
-    }                                                                       \
-    static int nm##_final(EVP_MD_CTX *ctx, unsigned char *md)               \
-    {                                                                       \
-        return fn##_final(md, EVP_MD_CTX_get0_md_data(ctx));                \
-    }
diff --git a/crypto/evp/legacy_ripemd.c b/crypto/evp/legacy_ripemd.c
index f031d16973..8f32e5ffbc 100644
--- a/crypto/evp/legacy_ripemd.c
+++ b/crypto/evp/legacy_ripemd.c
@@ -15,7 +15,6 @@

 #include <openssl/ripemd.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD ripemd160_md = {
     NID_ripemd160,
diff --git a/crypto/evp/legacy_sha.c b/crypto/evp/legacy_sha.c
index 3333e02377..437caf4113 100644
--- a/crypto/evp/legacy_sha.c
+++ b/crypto/evp/legacy_sha.c
@@ -16,10 +16,6 @@
 #include <openssl/sha.h> /* diverse SHA macros */
 #include "internal/sha3.h" /* KECCAK1600_WIDTH */
 #include "crypto/evp.h"
-/* Used by legacy methods */
-#include "crypto/sha.h"
-#include "legacy_meth.h"
-#include "evp_local.h"

 static const EVP_MD sha1_md = {
     NID_sha1,
diff --git a/crypto/evp/legacy_wp.c b/crypto/evp/legacy_wp.c
index 3fb202a898..e5a127d06c 100644
--- a/crypto/evp/legacy_wp.c
+++ b/crypto/evp/legacy_wp.c
@@ -15,7 +15,6 @@

 #include <openssl/whrlpool.h>
 #include "crypto/evp.h"
-#include "legacy_meth.h"

 static const EVP_MD whirlpool_md = {
     NID_whirlpool,
diff --git a/crypto/evp/m_null.c b/crypto/evp/m_null.c
index 316b964fc0..2337f0d19f 100644
--- a/crypto/evp/m_null.c
+++ b/crypto/evp/m_null.c
@@ -7,11 +7,6 @@
  * https://www.openssl.org/source/license.html
  */

-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/evp.h>
-#include <openssl/objects.h>
-#include <openssl/x509.h>
 #include "crypto/evp.h"

 static const EVP_MD null_md = {
diff --git a/crypto/sm3/legacy_sm3.c b/crypto/sm3/legacy_sm3.c
index b7129230fa..c37dbaab6d 100644
--- a/crypto/sm3/legacy_sm3.c
+++ b/crypto/sm3/legacy_sm3.c
@@ -9,7 +9,6 @@
  */

 #include "crypto/evp.h"
-#include "../evp/legacy_meth.h"
 #include "internal/sm3.h"

 static const EVP_MD sm3_md = {