]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/OpensslLib/EDKII_openssl-0.9.8l.patch
d14b08e770887f2740af105d5719d5bb279c067e
[mirror_edk2.git] / CryptoPkg / Library / OpensslLib / EDKII_openssl-0.9.8l.patch
1 --- crypto/bio/bss_file.c Thu Jan 15 17:14:12 1970
2 +++ crypto/bio/bss_file.c Thu Jan 15 17:14:12 1970
3 @@ -421,6 +421,23 @@
4 return(ret);
5 }
6
7 +#else
8 +
9 +BIO_METHOD *BIO_s_file(void)
10 + {
11 + return NULL;
12 + }
13 +
14 +BIO *BIO_new_file(const char *filename, const char *mode)
15 + {
16 + return NULL;
17 + }
18 +
19 +BIO *BIO_new_fp(FILE *stream, int close_flag)
20 + {
21 + return NULL;
22 + }
23 +
24 #endif /* OPENSSL_NO_STDIO */
25
26 #endif /* HEADER_BSS_FILE_C */
27 --- crypto/err/err.c
28 +++ crypto/err/err.c
29 @@ -313,7 +313,12 @@
30 es->err_data_flags[i]=flags;
31 }
32
33 +/* Add EFIAPI for UEFI version. */
34 +#if defined(OPENSSL_SYS_UEFI)
35 +void EFIAPI ERR_add_error_data(int num, ...)
36 +#else
37 void ERR_add_error_data(int num, ...)
38 +#endif
39 {
40 va_list args;
41 int i,n,s;
42 --- crypto/err/err.h
43 +++ crypto/err/err.h
44 @@ -286,8 +286,14 @@
45 #endif
46 #ifndef OPENSSL_NO_BIO
47 void ERR_print_errors(BIO *bp);
48 +
49 +/* Add EFIAPI for UEFI version. */
50 +#if defined(OPENSSL_SYS_UEFI)
51 +void EFIAPI ERR_add_error_data(int num, ...);
52 +#else
53 void ERR_add_error_data(int num, ...);
54 #endif
55 +#endif
56 void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
57 void ERR_unload_strings(int lib,ERR_STRING_DATA str[]);
58 void ERR_load_ERR_strings(void);
59 --- crypto/opensslconf.h
60 +++ crypto/opensslconf.h
61 @@ -162,6 +162,9 @@
62 /* The prime number generation stuff may not work when
63 * EIGHT_BIT but I don't care since I've only used this mode
64 * for debuging the bignum libraries */
65 +
66 +/* Bypass following definition for UEFI version. */
67 +#if !defined(OPENSSL_SYS_UEFI)
68 #undef SIXTY_FOUR_BIT_LONG
69 #undef SIXTY_FOUR_BIT
70 #define THIRTY_TWO_BIT
71 @@ -169,6 +172,8 @@
72 #undef EIGHT_BIT
73 #endif
74
75 +#endif
76 +
77 #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
78 #define CONFIG_HEADER_RC4_LOCL_H
79 /* if this is defined data[i] is used instead of *data, this is a %20
80 --- crypto/pkcs7/pk7_smime.c 2009-03-15 21:36:02.000000000 +0800
81 +++ crypto/pkcs7/pk7_smime.c 2011-09-13 14:11:36.019454700 +0800
82 @@ -88,7 +88,10 @@
83 if (!PKCS7_content_new(p7, NID_pkcs7_data))
84 goto err;
85
86 - if (!(si = PKCS7_add_signature(p7,signcert,pkey,EVP_sha1()))) {
87 + /*
88 + NOTE: Update to SHA-256 digest algorithm for UEFI version.
89 + */
90 + if (!(si = PKCS7_add_signature(p7,signcert,pkey,EVP_sha256()))) {
91 PKCS7err(PKCS7_F_PKCS7_SIGN,PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR);
92 goto err;
93 }
94 --- crypto/rand/rand_egd.c Thu Jan 15 17:14:12 1970
95 +++ crypto/rand/rand_egd.c Thu Jan 15 17:14:12 1970
96 @@ -95,7 +95,7 @@
97 * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
98 */
99
100 -#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)
101 +#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_UEFI)
102 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
103 {
104 return(-1);
105 --- crypto/rand/rand_unix.c Thu Jan 15 17:14:12 1970
106 +++ crypto/rand/rand_unix.c Thu Jan 15 17:14:12 1970
107 @@ -116,7 +116,7 @@
108 #include <openssl/rand.h>
109 #include "rand_lcl.h"
110
111 -#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE))
112 +#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_UEFI))
113
114 #include <sys/types.h>
115 #include <sys/time.h>
116 @@ -322,7 +322,7 @@
117 #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */
118
119
120 -#if defined(OPENSSL_SYS_VXWORKS)
121 +#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
122 int RAND_poll(void)
123 {
124 return 0;
125 --- crypto/x509/x509_vfy.c Thu Jan 15 17:14:12 1970
126 +++ crypto/x509/x509_vfy.c Thu Jan 15 17:14:12 1970
127 @@ -391,7 +391,12 @@
128
129 static int check_chain_extensions(X509_STORE_CTX *ctx)
130 {
131 -#ifdef OPENSSL_NO_CHAIN_VERIFY
132 +//#ifdef OPENSSL_NO_CHAIN_VERIFY
133 +#if defined(OPENSSL_NO_CHAIN_VERIFY) || defined(OPENSSL_SYS_UEFI)
134 + /*
135 + NOTE: Bypass KU Flags Checking for UEFI version. There are incorrect KU flag setting
136 + in Authenticode Signing Certificates.
137 + */
138 return 1;
139 #else
140 int i, ok=0, must_be_ca, plen = 0;
141 @@ -904,6 +909,10 @@
142
143 static int check_cert_time(X509_STORE_CTX *ctx, X509 *x)
144 {
145 +#if defined(OPENSSL_SYS_UEFI)
146 + /* Bypass Certificate Time Checking for UEFI version. */
147 + return 1;
148 +#else
149 time_t *ptime;
150 int i;
151
152 @@ -947,6 +956,7 @@
153 }
154
155 return 1;
156 +#endif
157 }
158
159 static int internal_verify(X509_STORE_CTX *ctx)