1 diff U3 crypto/bio/bio.h crypto/bio/bio.h
2 --- crypto/bio/bio.h Thu Jan 28 21:56:08 2016
3 +++ crypto/bio/bio.h Wed Feb 17 16:43:40 2016
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 Jan 28 21:38:30 2016
18 +++ crypto/bio/bss_file.c Wed Feb 17 16:01:02 2016
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 Jan 28 21:56:08 2016
45 +++ crypto/dh/dh_pmeth.c Wed Feb 17 16:15:58 2016
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 Jan 28 21:56:08 2016
66 +++ crypto/pem/pem.h Wed Feb 17 15:56:26 2016
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 Jan 28 21:56:08 2016
77 +++ crypto/pkcs7/pk7_smime.c Wed Feb 17 16:22:45 2016
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;
87 BIO *tmpin = NULL, *tmpout = NULL;
92 - /* Check for data and content: two sets of data */
93 - if (!PKCS7_get_detached(p7) && indata) {
94 - PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_CONTENT_AND_DATA_PRESENT);
98 sinfos = PKCS7_get_signer_info(p7);
100 if (!sinfos || !sk_PKCS7_SIGNER_INFO_num(sinfos)) {
106 + buf = OPENSSL_malloc(bufsiz);
110 /* We now have to 'read' from p7bio to calculate digests etc. */
112 - i = BIO_read(p7bio, buf, sizeof(buf));
113 + i = BIO_read(p7bio, buf, bufsiz);
120 sk_X509_free(signers);
127 diff U3 crypto/rand/rand_unix.c crypto/rand/rand_unix.c
128 --- crypto/rand/rand_unix.c Thu Jan 28 21:38:32 2016
129 +++ crypto/rand/rand_unix.c Wed Feb 17 15:40:02 2016
131 #include <openssl/rand.h>
132 #include "rand_lcl.h"
134 -#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))
135 +#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))
137 # include <sys/types.h>
138 # include <sys/time.h>
140 * defined(OPENSSL_SYS_VXWORKS) ||
141 * defined(OPENSSL_SYS_NETWARE)) */
143 -#if defined(OPENSSL_SYS_VXWORKS)
144 +#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
148 diff U3 crypto/rsa/rsa_ameth.c crypto/rsa/rsa_ameth.c
149 --- crypto/rsa/rsa_ameth.c Thu Jan 28 21:56:08 2016
150 +++ crypto/rsa/rsa_ameth.c Wed Feb 17 15:09:46 2016
153 #include "asn1_locl.h"
155 +#ifndef OPENSSL_NO_CMS
156 static int rsa_cms_sign(CMS_SignerInfo *si);
157 static int rsa_cms_verify(CMS_SignerInfo *si);
158 static int rsa_cms_decrypt(CMS_RecipientInfo *ri);
159 static int rsa_cms_encrypt(CMS_RecipientInfo *ri);
162 static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
168 +#ifndef OPENSSL_NO_CMS
169 static int rsa_cms_verify(CMS_SignerInfo *si)
179 * Customised RSA item verification routine. This is called when a signature
184 +#ifndef OPENSSL_NO_CMS
185 static int rsa_cms_sign(CMS_SignerInfo *si)
187 int pad_mode = RSA_PKCS1_PADDING;
189 X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os);
194 static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
195 X509_ALGOR *alg1, X509_ALGOR *alg2,
200 +#ifndef OPENSSL_NO_CMS
201 static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
205 X509_ALGOR_free(maskHash);
210 +#ifndef OPENSSL_NO_CMS
211 static int rsa_cms_encrypt(CMS_RecipientInfo *ri)
213 const EVP_MD *md, *mgf1md;
215 ASN1_STRING_free(os);
220 const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = {
222 diff U3 crypto/x509/x509_vfy.c crypto/x509/x509_vfy.c
223 --- crypto/x509/x509_vfy.c Thu Jan 28 21:56:08 2016
224 +++ crypto/x509/x509_vfy.c Wed Feb 17 16:09:58 2016
226 ctx->current_crl = crl;
227 if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME)
228 ptime = &ctx->param->check_time;
229 + else if (ctx->param->flags & X509_V_FLAG_NO_CHECK_TIME)
234 @@ -1663,6 +1665,8 @@
236 if (ctx->param->flags & X509_V_FLAG_USE_CHECK_TIME)
237 ptime = &ctx->param->check_time;
238 + else if (ctx->param->flags & X509_V_FLAG_NO_CHECK_TIME)
243 diff U3 crypto/x509/x509_vfy.h crypto/x509/x509_vfy.h
244 --- crypto/x509/x509_vfy.h Thu Jan 28 21:56:08 2016
245 +++ crypto/x509/x509_vfy.h Wed Feb 17 16:08:18 2016
247 * will force the behaviour to match that of previous versions.
249 # define X509_V_FLAG_NO_ALT_CHAINS 0x100000
250 +/* Do not check certificate/CRL validity against current time */
251 +# define X509_V_FLAG_NO_CHECK_TIME 0x200000
253 # define X509_VP_FLAG_DEFAULT 0x1
254 # define X509_VP_FLAG_OVERWRITE 0x2
255 diff U3 crypto/x509v3/ext_dat.h crypto/x509v3/ext_dat.h
256 --- crypto/x509v3/ext_dat.h Thu Jan 28 21:56:08 2016
257 +++ crypto/x509v3/ext_dat.h Wed Feb 17 16:13:30 2016
262 +#ifndef OPENSSL_SYS_UEFI
268 /* Number of standard extensions */
269 diff U3 crypto/crypto.h crypto/crypto.h
270 --- crypto/crypto.h Thu Jan 28 21:38:30 2016
271 +++ crypto/crypto.h Wed Feb 17 16:33:00 2016
272 @@ -235,15 +235,15 @@
273 # ifndef OPENSSL_NO_LOCKING
274 # ifndef CRYPTO_w_lock
275 # define CRYPTO_w_lock(type) \
276 - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
277 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,NULL,0)
278 # define CRYPTO_w_unlock(type) \
279 - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
280 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,NULL,0)
281 # define CRYPTO_r_lock(type) \
282 - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
283 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,NULL,0)
284 # define CRYPTO_r_unlock(type) \
285 - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
286 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,NULL,0)
287 # define CRYPTO_add(addr,amount,type) \
288 - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
289 + CRYPTO_add_lock(addr,amount,type,NULL,0)
292 # define CRYPTO_w_lock(a)
293 @@ -378,19 +378,19 @@
294 # define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
295 # define is_MemCheck_on() CRYPTO_is_mem_check_on()
297 -# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
298 -# define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
299 +# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,NULL,0)
300 +# define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0)
301 # define OPENSSL_realloc(addr,num) \
302 - CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
303 + CRYPTO_realloc((char *)addr,(int)num,NULL,0)
304 # define OPENSSL_realloc_clean(addr,old_num,num) \
305 - CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
306 + CRYPTO_realloc_clean(addr,old_num,num,NULL,0)
307 # define OPENSSL_remalloc(addr,num) \
308 - CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
309 + CRYPTO_remalloc((char **)addr,(int)num,NULL,0)
310 # define OPENSSL_freeFunc CRYPTO_free
311 # define OPENSSL_free(addr) CRYPTO_free(addr)
313 # define OPENSSL_malloc_locked(num) \
314 - CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
315 + CRYPTO_malloc_locked((int)num,NULL,0)
316 # define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
318 const char *SSLeay_version(int type);
320 long CRYPTO_get_mem_debug_options(void);
322 # define CRYPTO_push_info(info) \
323 - CRYPTO_push_info_(info, __FILE__, __LINE__);
324 + CRYPTO_push_info_(info, NULL, 0);
325 int CRYPTO_push_info_(const char *info, const char *file, int line);
326 int CRYPTO_pop_info(void);
327 int CRYPTO_remove_all_info(void);
330 /* die if we have to */
331 void OpenSSLDie(const char *file, int line, const char *assertion);
332 -# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
333 +# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(NULL, 0, #e),1))
335 unsigned long *OPENSSL_ia32cap_loc(void);
336 # define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
337 @@ -605,14 +605,14 @@
338 # define fips_md_init_ctx(alg, cx) \
339 int alg##_Init(cx##_CTX *c) \
341 - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
342 + if (FIPS_mode()) OpenSSLDie(NULL, 0, \
343 "Low level API call to digest " #alg " forbidden in FIPS mode!"); \
344 return private_##alg##_Init(c); \
346 int private_##alg##_Init(cx##_CTX *c)
348 # define fips_cipher_abort(alg) \
349 - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
350 + if (FIPS_mode()) OpenSSLDie(NULL, 0, \
351 "Low level API call to cipher " #alg " forbidden in FIPS mode!")
354 diff U3 e_os.h e_os.h
355 --- e_os.h Thu Jan 28 21:56:08 2016
356 +++ e_os.h Wed Feb 17 15:52:08 2016
361 -# if defined(MSDOS) && !defined(GETPID_IS_MEANINGLESS)
362 +# if (defined(MSDOS) || defined(OPENSSL_SYS_UEFI)) && !defined(GETPID_IS_MEANINGLESS)
363 # define GETPID_IS_MEANINGLESS
366 diff U3 e_os2.h e_os2.h
367 --- e_os2.h Thu Jan 28 21:56:08 2016
368 +++ e_os2.h Wed Feb 17 15:53:08 2016
370 * For 32 bit environment, there seems to be the CygWin environment and then
371 * all the others that try to do the same thing Microsoft does...
373 -# if defined(OPENSSL_SYSNAME_UWIN)
375 + * UEFI lives here because it might be built with a Microsoft toolchain and
376 + * we need to avoid the false positive match on Windows.
378 +# if defined(OPENSSL_SYSNAME_UEFI)
379 +# undef OPENSSL_SYS_UNIX
380 +# define OPENSSL_SYS_UEFI
381 +# elif defined(OPENSSL_SYSNAME_UWIN)
382 # undef OPENSSL_SYS_UNIX
383 # define OPENSSL_SYS_WIN32_UWIN