]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3969
authorQin Long <qin.long@intel.com>
Sat, 5 Mar 2016 15:43:21 +0000 (23:43 +0800)
committerQin Long <qin.long@intel.com>
Sat, 5 Mar 2016 15:43:21 +0000 (23:43 +0800)
Support for the UEFI target has been added to OpenSSL in commit 4d60c7e10.

Drop our partial implementation and use a backported version of what's
upstream. This includes a couple of fixes which will be needed when we
automatically generate the file list and opensslconf.h instead of
manually maintaining those.

This includes the subsequent fix in commit fb4844bbc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
CryptoPkg/Library/OpensslLib/EDKII_openssl-1.0.2f.patch

index 6607200b02a9ca248325411fb5af6e450b1075d8..c4d0b6569755c3c44bd89fd7e239187cb958c63c 100644 (file)
@@ -1,8 +1,18 @@
 diff --git a/Configure b/Configure\r
-index 4a715dc..eb61eda 100755\r
+index 4a715dc..b4a4781 100755\r
 --- a/Configure\r
 +++ b/Configure\r
-@@ -1082,7 +1082,7 @@ if (defined($disabled{"tls1"}))\r
+@@ -605,6 +605,9 @@ my %table=(\r
+ # with itself, Applink is never engaged and can as well be omitted.\r
+ "mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",\r
\r
++# UEFI\r
++"UEFI", "cc:-DL_ENDIAN -O:::UEFI::::",\r
++\r
+ # UWIN \r
+ "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",\r
\r
+@@ -1082,7 +1085,7 @@ if (defined($disabled{"tls1"}))\r
        }\r
  \r
  if (defined($disabled{"ec"}) || defined($disabled{"dsa"})\r
@@ -839,7 +849,7 @@ index 585aa8b..04c6cfc 100644
  /*\r
   * Borland C seems too stupid to be able to shift and do longs in the\r
 diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in\r
-index 7a1c85d..a5f51a7 100644\r
+index 7a1c85d..7162c0f 100644\r
 --- a/crypto/opensslconf.h.in\r
 +++ b/crypto/opensslconf.h.in\r
 @@ -1,5 +1,15 @@\r
@@ -858,6 +868,15 @@ index 7a1c85d..a5f51a7 100644
  /* Generate 80386 code? */\r
  #undef I386_ONLY\r
  \r
+@@ -56,7 +66,7 @@\r
+ #endif\r
+ #endif\r
\r
+-#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)\r
++#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) && !defined(OPENSSL_SYSNAME_UEFI)\r
+ #define CONFIG_HEADER_BN_H\r
+ #undef BN_LLONG\r
\r
 diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h\r
 index d3b23fc..87b0b6a 100644\r
 --- a/crypto/pem/pem.h\r
@@ -1052,6 +1071,19 @@ index c4d3724..0bc3d43 100644
 +    BIO_free_all(tmpmem);\r
 +    return ret;\r
  }\r
+diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c\r
+index 737aebf..f23f348 100644\r
+--- a/crypto/rand/rand_egd.c\r
++++ b/crypto/rand/rand_egd.c\r
+@@ -95,7 +95,7 @@\r
+  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.\r
+  */\r
\r
+-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_BEOS)\r
++#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_BEOS) || defined(OPENSSL_SYS_UEFI)\r
+ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)\r
+ {\r
+     return (-1);\r
 diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c\r
 index 266111e..f60fac6 100644\r
 --- a/crypto/rand/rand_unix.c\r