1 diff U3 crypto/bio/bio.h crypto/bio/bio.h
2 --- crypto/bio/bio.h Thu Jun 11 21:50:12 2015
3 +++ crypto/bio/bio.h Fri Jun 12 11:00:52 2015
5 int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
6 asn1_ps_func **psuffix_free);
8 -# ifndef OPENSSL_NO_FP_API
9 BIO_METHOD *BIO_s_file(void);
10 BIO *BIO_new_file(const char *filename, const char *mode);
11 BIO *BIO_new_fp(FILE *stream, int close_flag);
12 +# ifndef OPENSSL_NO_FP_API
13 # define BIO_s_file_internal BIO_s_file
15 BIO *BIO_new(BIO_METHOD *type);
16 diff U3 crypto/bio/bss_file.c crypto/bio/bss_file.c
17 --- crypto/bio/bss_file.c Thu Jun 11 21:01:06 2015
18 +++ crypto/bio/bss_file.c Fri Jun 12 11:01:28 2015
25 +BIO_METHOD *BIO_s_file(void)
30 +BIO *BIO_new_file(const char *filename, const char *mode)
35 +BIO *BIO_new_fp(FILE *stream, int close_flag)
40 # endif /* OPENSSL_NO_STDIO */
42 #endif /* HEADER_BSS_FILE_C */
43 diff U3 crypto/dh/dh_pmeth.c crypto/dh/dh_pmeth.c
44 --- crypto/dh/dh_pmeth.c Thu Jun 11 21:50:12 2015
45 +++ crypto/dh/dh_pmeth.c Fri Jun 12 11:08:48 2015
49 } else if (dctx->kdf_type == EVP_PKEY_DH_KDF_X9_42) {
50 +#ifdef OPENSSL_NO_CMS
53 unsigned char *Z = NULL;
55 if (!dctx->kdf_outlen || !dctx->kdf_oid)
64 diff U3 crypto/pem/pem.h crypto/pem/pem.h
65 --- crypto/pem/pem.h Thu Jun 11 21:50:12 2015
66 +++ crypto/pem/pem.h Fri Jun 12 10:58:18 2015
69 # define DECLARE_PEM_read_fp(name, type) /**/
70 # define DECLARE_PEM_write_fp(name, type) /**/
71 +# define DECLARE_PEM_write_fp_const(name, type) /**/
72 # define DECLARE_PEM_write_cb_fp(name, type) /**/
75 diff U3 crypto/pkcs7/pk7_smime.c crypto/pkcs7/pk7_smime.c
76 --- crypto/pkcs7/pk7_smime.c Thu Jun 11 21:01:06 2015
77 +++ crypto/pkcs7/pk7_smime.c Fri Jun 12 11:23:38 2015
79 STACK_OF(PKCS7_SIGNER_INFO) *sinfos;
80 PKCS7_SIGNER_INFO *si;
81 X509_STORE_CTX cert_ctx;
85 int i, j = 0, k, ret = 0;
93 + buf = OPENSSL_malloc(bufsiz);
97 /* We now have to 'read' from p7bio to calculate digests etc. */
99 - i = BIO_read(p7bio, buf, sizeof(buf));
100 + i = BIO_read(p7bio, buf, bufsiz);
107 sk_X509_free(signers);
115 diff U3 crypto/rand/rand_unix.c crypto/rand/rand_unix.c
116 --- crypto/rand/rand_unix.c Thu Jun 11 21:01:06 2015
117 +++ crypto/rand/rand_unix.c Fri Jun 12 10:51:21 2015
119 #include <openssl/rand.h>
120 #include "rand_lcl.h"
122 -#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))
123 +#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))
125 # include <sys/types.h>
126 # include <sys/time.h>
128 * defined(OPENSSL_SYS_VXWORKS) ||
129 * defined(OPENSSL_SYS_NETWARE)) */
131 -#if defined(OPENSSL_SYS_VXWORKS)
132 +#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
136 diff U3 crypto/rsa/rsa_ameth.c crypto/rsa/rsa_ameth.c
137 --- crypto/rsa/rsa_ameth.c Thu Jun 11 21:50:12 2015
138 +++ crypto/rsa/rsa_ameth.c Fri Jun 12 10:45:38 2015
141 #include "asn1_locl.h"
143 +#ifndef OPENSSL_NO_CMS
144 static int rsa_cms_sign(CMS_SignerInfo *si);
145 static int rsa_cms_verify(CMS_SignerInfo *si);
146 static int rsa_cms_decrypt(CMS_RecipientInfo *ri);
147 static int rsa_cms_encrypt(CMS_RecipientInfo *ri);
150 static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
156 +#ifndef OPENSSL_NO_CMS
157 static int rsa_cms_verify(CMS_SignerInfo *si)
167 * Customised RSA item verification routine. This is called when a signature
172 +#ifndef OPENSSL_NO_CMS
173 static int rsa_cms_sign(CMS_SignerInfo *si)
175 int pad_mode = RSA_PKCS1_PADDING;
177 X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os);
182 static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
183 X509_ALGOR *alg1, X509_ALGOR *alg2,
188 +#ifndef OPENSSL_NO_CMS
189 static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
193 X509_ALGOR_free(maskHash);
198 +#ifndef OPENSSL_NO_CMS
199 static int rsa_cms_encrypt(CMS_RecipientInfo *ri)
201 const EVP_MD *md, *mgf1md;
203 ASN1_STRING_free(os);
208 const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
210 diff U3 crypto/x509/x509_vfy.c crypto/x509/x509_vfy.c
211 --- crypto/x509/x509_vfy.c Thu Jun 11 21:52:58 2015
212 +++ crypto/x509/x509_vfy.c Fri Jun 12 11:29:37 2015
213 @@ -1647,6 +1647,10 @@
215 static int check_cert_time(X509_STORE_CTX *ctx, X509 *x)
217 +#ifdef OPENSSL_SYS_UEFI
218 + /* Bypass Certificate Time Checking for UEFI version. */
224 @@ -1686,6 +1690,7 @@
231 static int internal_verify(X509_STORE_CTX *ctx)
232 diff U3 crypto/x509v3/ext_dat.h crypto/x509v3/ext_dat.h
233 --- crypto/x509v3/ext_dat.h Thu Jun 11 21:50:12 2015
234 +++ crypto/x509v3/ext_dat.h Fri Jun 12 11:11:03 2015
239 +#ifndef OPENSSL_SYS_UEFI
245 /* Number of standard extensions */
246 diff U3 crypto/crypto.h crypto/crypto.h
247 --- crypto/crypto.h Thu Jun 11 21:01:06 2015
248 +++ crypto/crypto.h Fri Jun 12 11:33:27 2015
249 @@ -235,15 +235,15 @@
250 # ifndef OPENSSL_NO_LOCKING
251 # ifndef CRYPTO_w_lock
252 # define CRYPTO_w_lock(type) \
253 - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
254 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,NULL,0)
255 # define CRYPTO_w_unlock(type) \
256 - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
257 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,NULL,0)
258 # define CRYPTO_r_lock(type) \
259 - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
260 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,NULL,0)
261 # define CRYPTO_r_unlock(type) \
262 - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
263 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,NULL,0)
264 # define CRYPTO_add(addr,amount,type) \
265 - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
266 + CRYPTO_add_lock(addr,amount,type,NULL,0)
269 # define CRYPTO_w_lock(a)
270 @@ -378,19 +378,19 @@
271 # define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
272 # define is_MemCheck_on() CRYPTO_is_mem_check_on()
274 -# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
275 -# define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
276 +# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,NULL,0)
277 +# define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0)
278 # define OPENSSL_realloc(addr,num) \
279 - CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
280 + CRYPTO_realloc((char *)addr,(int)num,NULL,0)
281 # define OPENSSL_realloc_clean(addr,old_num,num) \
282 - CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
283 + CRYPTO_realloc_clean(addr,old_num,num,NULL,0)
284 # define OPENSSL_remalloc(addr,num) \
285 - CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
286 + CRYPTO_remalloc((char **)addr,(int)num,NULL,0)
287 # define OPENSSL_freeFunc CRYPTO_free
288 # define OPENSSL_free(addr) CRYPTO_free(addr)
290 # define OPENSSL_malloc_locked(num) \
291 - CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
292 + CRYPTO_malloc_locked((int)num,NULL,0)
293 # define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
295 const char *SSLeay_version(int type);
297 long CRYPTO_get_mem_debug_options(void);
299 # define CRYPTO_push_info(info) \
300 - CRYPTO_push_info_(info, __FILE__, __LINE__);
301 + CRYPTO_push_info_(info, NULL, 0);
302 int CRYPTO_push_info_(const char *info, const char *file, int line);
303 int CRYPTO_pop_info(void);
304 int CRYPTO_remove_all_info(void);
307 /* die if we have to */
308 void OpenSSLDie(const char *file, int line, const char *assertion);
309 -# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
310 +# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(NULL, 0, #e),1))
312 unsigned long *OPENSSL_ia32cap_loc(void);
313 # define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
314 @@ -605,14 +605,14 @@
315 # define fips_md_init_ctx(alg, cx) \
316 int alg##_Init(cx##_CTX *c) \
318 - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
319 + if (FIPS_mode()) OpenSSLDie(NULL, 0, \
320 "Low level API call to digest " #alg " forbidden in FIPS mode!"); \
321 return private_##alg##_Init(c); \
323 int private_##alg##_Init(cx##_CTX *c)
325 # define fips_cipher_abort(alg) \
326 - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
327 + if (FIPS_mode()) OpenSSLDie(NULL, 0, \
328 "Low level API call to cipher " #alg " forbidden in FIPS mode!")
331 diff U3 crypto/opensslconf.h crypto/opensslconf.h
332 --- crypto/opensslconf.h Thu Jun 11 21:55:38 2015
333 +++ crypto/opensslconf.h Fri Jun 12 10:28:27 2015
335 /* Should we define BN_DIV2W here? */
337 /* Only one for the following should be defined */
338 +/* Bypass the following definitions for UEFI version. */
339 +#if !defined(OPENSSL_SYS_UEFI)
340 #undef SIXTY_FOUR_BIT_LONG
341 #undef SIXTY_FOUR_BIT
342 #define THIRTY_TWO_BIT
346 #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
347 diff U3 crypto/err/err.c crypto/err/err.c
350 @@ -1072,7 +1072,12 @@ void ERR_set_error_data(char *data, int flags)
351 es->err_data_flags[i] = flags;
354 +/* Add EFIAPI for UEFI version. */
355 +#if defined(OPENSSL_SYS_UEFI)
356 +void EFIAPI ERR_add_error_data(int num, ...)
358 void ERR_add_error_data(int num, ...)
363 diff U3 crypto/err/err.h crypto/err/err.h
366 @@ -344,7 +344,14 @@ void ERR_print_errors_fp(FILE *fp);
367 # ifndef OPENSSL_NO_BIO
368 void ERR_print_errors(BIO *bp);
371 +/* Add EFIAPI for UEFI version. */
372 +#if defined(OPENSSL_SYS_UEFI)
373 +void EFIAPI ERR_add_error_data(int num, ...);
375 void ERR_add_error_data(int num, ...);
378 void ERR_add_error_vdata(int num, va_list args);
379 void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
380 void ERR_unload_strings(int lib, ERR_STRING_DATA str[]);