From: Richard Levitte Date: Wed, 8 Oct 2025 20:55:45 +0000 (+0200) Subject: Cleanup: Remove include/crypto/bn_conf.h.in X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ab2ece0a2025ebdea1f94744424ef89ffb9a2b0;p=thirdparty%2Fopenssl.git Cleanup: Remove include/crypto/bn_conf.h.in It turns out that this reproduces what's already done conditionally in include/openssl/configuration.h.in. Furthermore, include/crypto/bn_conf.h was only included in crypto/bn/bn_local.h using the same guard as the definition in include/openssl/configuration.h, which is already included by crypto/bn/bn_local.h anyway, via include/openssl/opensslconf.h. Therefore, include/crypto/bn_conf.h.in can be removed, alongside the construction and inclusion of include/crypto/bn_conf.h. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28794) --- diff --git a/build.info b/build.info index 92b698ab138..e85cd99e56e 100644 --- a/build.info +++ b/build.info @@ -47,7 +47,7 @@ DEPEND[]=include/openssl/asn1.h \ include/openssl/x509v3.h \ include/openssl/x509_acert.h \ include/openssl/x509_vfy.h \ - include/crypto/bn_conf.h include/crypto/dso_conf.h \ + include/crypto/dso_conf.h \ providers/implementations/asymciphers/rsa_enc.inc \ providers/implementations/asymciphers/sm2_enc.inc \ providers/implementations/exchange/dh_exch.inc \ @@ -163,7 +163,6 @@ GENERATE[include/openssl/x509.h]=include/openssl/x509.h.in GENERATE[include/openssl/x509v3.h]=include/openssl/x509v3.h.in GENERATE[include/openssl/x509_acert.h]=include/openssl/x509_acert.h.in GENERATE[include/openssl/x509_vfy.h]=include/openssl/x509_vfy.h.in -GENERATE[include/crypto/bn_conf.h]=include/crypto/bn_conf.h.in GENERATE[include/crypto/dso_conf.h]=include/crypto/dso_conf.h.in DEPEND[providers/implementations/asymciphers/rsa_enc.inc \ diff --git a/crypto/bn/bn_local.h b/crypto/bn/bn_local.h index 057da6e1e6e..10b93729a73 100644 --- a/crypto/bn/bn_local.h +++ b/crypto/bn/bn_local.h @@ -10,20 +10,10 @@ #ifndef OSSL_CRYPTO_BN_LOCAL_H # define OSSL_CRYPTO_BN_LOCAL_H -/* - * The EDK2 build doesn't use bn_conf.h; it sets THIRTY_TWO_BIT or - * SIXTY_FOUR_BIT in its own environment since it doesn't re-run our - * Configure script and needs to support both 32-bit and 64-bit. - */ # include - -# if !defined(OPENSSL_SYS_UEFI) -# include "crypto/bn_conf.h" -# endif - -# include "crypto/bn.h" # include "internal/cryptlib.h" # include "internal/numbers.h" +# include "crypto/bn.h" /* * These preprocessor symbols control various aspects of the bignum headers diff --git a/include/crypto/bn_conf.h.in b/include/crypto/bn_conf.h.in deleted file mode 100644 index dbc901b145e..00000000000 --- a/include/crypto/bn_conf.h.in +++ /dev/null @@ -1,28 +0,0 @@ -{- join("\n",map { "/* $_ */" } @autowarntext) -} -/* - * Copyright 2016-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 - */ - -#ifndef OSSL_CRYPTO_BN_CONF_H -# define OSSL_CRYPTO_BN_CONF_H -# pragma once - -/* - * The contents of this file are not used in the UEFI build, as - * both 32-bit and 64-bit builds are supported from a single run - * of the Configure script. - */ - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -{- $config{b64l} ? "#define" : "#undef" -} SIXTY_FOUR_BIT_LONG -{- $config{b64} ? "#define" : "#undef" -} SIXTY_FOUR_BIT -{- $config{b32} ? "#define" : "#undef" -} THIRTY_TWO_BIT - -#endif diff --git a/include/openssl/configuration.h.in b/include/openssl/configuration.h.in index 86077d0a6f5..aeac5106f32 100644 --- a/include/openssl/configuration.h.in +++ b/include/openssl/configuration.h.in @@ -50,7 +50,10 @@ extern "C" { {- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY /* - * The following are cipher-specific, but are part of the public API. + * The UEFI build supports both 32-bit and 64-bit builds from a single run + * of the Configure script. To allow this, they define THIRTY_TWO_BIT and + * SIXTY_FOUR_BIT appropriately for their builds, and we should not touch + * them in that case. */ # if !defined(OPENSSL_SYS_UEFI) {- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG @@ -60,6 +63,9 @@ extern "C" { {- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT # endif +/* + * The following are cipher-specific, but are part of the public API. + */ # define RC4_INT {- $config{rc4_int} -} # if defined(OPENSSL_NO_COMP) || (defined(OPENSSL_NO_BROTLI) && defined(OPENSSL_NO_ZSTD) && defined(OPENSSL_NO_ZLIB)) diff --git a/util/fix-includes.sed b/util/fix-includes.sed index db66809a197..5b9a834b862 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_conf.h|bn_conf.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|engine.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|engine.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/constant_time_locl/constant_time/g ; s/_lo?cl\.h/_local.h/g ; s/_int\.h/_local.h/g ;