summaryrefslogtreecommitdiff
path: root/Cryptlib/Include/OpenSslSupport.h
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2016-09-21 20:29:42 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2016-09-21 20:29:42 -0400
commit62f0afa2ecead02b1258dabab8097ca278a22f8f (patch)
tree56132d617fff7c4f05e67024ec872d88fcafa92d /Cryptlib/Include/OpenSslSupport.h
parentd3819813b8e0a64400ddf3ce033bae7c3f245508 (diff)
downloadefi-boot-shim-62f0afa2ecead02b1258dabab8097ca278a22f8f.tar.gz
efi-boot-shim-62f0afa2ecead02b1258dabab8097ca278a22f8f.zip
Import upstream version 0.9+1474479173.6c180c6
Diffstat (limited to 'Cryptlib/Include/OpenSslSupport.h')
-rw-r--r--Cryptlib/Include/OpenSslSupport.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/Cryptlib/Include/OpenSslSupport.h b/Cryptlib/Include/OpenSslSupport.h
index 004c3e8e..f73bbc9b 100644
--- a/Cryptlib/Include/OpenSslSupport.h
+++ b/Cryptlib/Include/OpenSslSupport.h
@@ -26,6 +26,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define CONST const
//
+// OpenSSL relies on explicit configuration for word size in crypto/bn,
+// but we want it to be automatically inferred from the target. So we
+// bypass what's in <openssl/opensslconf.h> for OPENSSL_SYS_UEFI, and
+// define our own here.
+//
+#ifdef CONFIG_HEADER_BN_H
+#error CONFIG_HEADER_BN_H already defined
+#endif
+
+#define CONFIG_HEADER_BN_H
+
+#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64)
+//
+// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs
+// SIXTY_FOUR_BIT, because 'long' is 32-bit and only 'long long' is
+// 64-bit. Since using 'long long' works fine on GCC too, just do that.
+//
+#define SIXTY_FOUR_BIT
+#elif defined(MDE_CPU_IA32) || defined(MDE_CPU_ARM) || defined(MDE_CPU_EBC)
+#define THIRTY_TWO_BIT
+#else
+#error Unknown target architecture
+#endif
+
+//
// File operations are not required for building Open SSL,
// so FILE is mapped to VOID * to pass build
//
@@ -211,7 +236,7 @@ struct tm {
struct timeval {
long tv_sec; /* time value, in seconds */
long tv_usec; /* time value, in microseconds */
-} timeval;
+};
struct dirent {
UINT32 d_fileno; /* file number of entry */