[openssl-dev] [openssl.org #4339] [PATCH] Fix handling of <internal/bn_conf.h> in UEFI build
David Woodhouse via RT
rt at openssl.org
Tue Feb 23 15:08:02 UTC 2016
The entire contents of <internal/bn_conf.h> are unwanted in the UEFI
build because we have to do it differently there. To support building
for both 32-bit and 64-bit platforms without re-running the OpenSSL
Configure script, the EDK2 environment defines THIRTY_TWO_BIT or
SIXTY_FOUR_BIT for itself according to the target platform.
The current setup is broken, though. It checks for OPENSSL_SYS_UEFI but
before it's actually defined, since opensslconf.h hasn't yet been
included.
Let's fix that by including opensslconf.h. And also let's move the
bn_conf.h doesn't even need to *exist* in the UEFI build environment.
---
crypto/bn/bn_lcl.h | 6 ++++++
crypto/include/internal/bn_conf.h.in | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h
index 0f3205c..a0a857b 100644
--- a/crypto/bn/bn_lcl.h
+++ b/crypto/bn/bn_lcl.h
@@ -111,7 +111,13 @@
#ifndef HEADER_BN_LCL_H
# define HEADER_BN_LCL_H
+/* The EDK2 build sets these externally since it doesn't re-run our
+ * own Configure script and needs to support both 32-bit and 64-bit */
+#include <openssl/opensslconf.h>
+
+# if !defined(OPENSSL_SYS_UEFI)
# include "internal/bn_conf.h"
+# endif
# include "internal/bn_int.h"
#ifdef __cplusplus
diff --git a/crypto/include/internal/bn_conf.h.in b/crypto/include/internal/bn_conf.h.in
index 5ebd55d..ceb4cba 100644
--- a/crypto/include/internal/bn_conf.h.in
+++ b/crypto/include/internal/bn_conf.h.in
@@ -56,7 +56,9 @@
#ifndef HEADER_BN_CONF_H
# define HEADER_BN_CONF_H
-# if !defined(OPENSSL_SYS_UEFI)
+/* 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? */
@@ -64,6 +66,5 @@
{- $config{b64l} ? "#define" : "#undef" -} SIXTY_FOUR_BIT_LONG
{- $config{b64} ? "#define" : "#undef" -} SIXTY_FOUR_BIT
{- $config{b32} ? "#define" : "#undef" -} THIRTY_TWO_BIT
-# endif
#endif
--
2.5.0
--
David Woodhouse Open Source Technology Centre
David.Woodhouse at intel.com Intel Corporation
--
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4339
Please log in as guest with password guest if prompted
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5691 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160223/00b86ad5/attachment-0001.bin>
More information about the openssl-dev
mailing list