]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Cleanup: Remove include/crypto/bn_conf.h.in
authorRichard Levitte <levitte@openssl.org>
Wed, 8 Oct 2025 20:55:45 +0000 (22:55 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 27 Oct 2025 07:43:41 +0000 (08:43 +0100)
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 <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28794)

build.info
crypto/bn/bn_local.h
include/crypto/bn_conf.h.in [deleted file]
include/openssl/configuration.h.in
util/fix-includes.sed

index 92b698ab1382d27e8c07da6df1f0222924aa2ebd..e85cd99e56ea57ad498f4fbb709428576d27cdc9 100644 (file)
@@ -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 \
index 057da6e1e6e53c7e1ee11dcb71f31b5013ffc593..10b93729a7346c95b94f24ab78466a932bc34833 100644 (file)
 #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 <openssl/opensslconf.h>
-
-# 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 (file)
index dbc901b..0000000
+++ /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
index 86077d0a6f5d6b6b06bb32b2d1d96a2958227b62..aeac5106f32539d86e2e6ac783d5c4dc07909279 100644 (file)
@@ -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))
index db66809a1975c8aaa7797605677bfc32093acf4d..5b9a834b86264eddc31dcb48d59213e5733713de 100644 (file)
@@ -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 ;