Skip to content

Commit 08c8ae4

Browse files
author
Shigeki Ohtsu
committed
deps: upgrade openssl sources to 1.0.1t
This just replaces all sources of openssl-1.0.1t.tar.gz into deps/openssl/openssl. Fixes: #6458 PR-URL: #6553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 98060a4 commit 08c8ae4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+889
-37674
lines changed

deps/openssl/openssl/CHANGES

+97
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,103 @@
22
OpenSSL CHANGES
33
_______________
44

5+
Changes between 1.0.1s and 1.0.1t [3 May 2016]
6+
7+
*) Prevent padding oracle in AES-NI CBC MAC check
8+
9+
A MITM attacker can use a padding oracle attack to decrypt traffic
10+
when the connection uses an AES CBC cipher and the server support
11+
AES-NI.
12+
13+
This issue was introduced as part of the fix for Lucky 13 padding
14+
attack (CVE-2013-0169). The padding check was rewritten to be in
15+
constant time by making sure that always the same bytes are read and
16+
compared against either the MAC or padding bytes. But it no longer
17+
checked that there was enough data to have both the MAC and padding
18+
bytes.
19+
20+
This issue was reported by Juraj Somorovsky using TLS-Attacker.
21+
(CVE-2016-2107)
22+
[Kurt Roeckx]
23+
24+
*) Fix EVP_EncodeUpdate overflow
25+
26+
An overflow can occur in the EVP_EncodeUpdate() function which is used for
27+
Base64 encoding of binary data. If an attacker is able to supply very large
28+
amounts of input data then a length check can overflow resulting in a heap
29+
corruption.
30+
31+
Internally to OpenSSL the EVP_EncodeUpdate() function is primarly used by
32+
the PEM_write_bio* family of functions. These are mainly used within the
33+
OpenSSL command line applications, so any application which processes data
34+
from an untrusted source and outputs it as a PEM file should be considered
35+
vulnerable to this issue. User applications that call these APIs directly
36+
with large amounts of untrusted data may also be vulnerable.
37+
38+
This issue was reported by Guido Vranken.
39+
(CVE-2016-2105)
40+
[Matt Caswell]
41+
42+
*) Fix EVP_EncryptUpdate overflow
43+
44+
An overflow can occur in the EVP_EncryptUpdate() function. If an attacker
45+
is able to supply very large amounts of input data after a previous call to
46+
EVP_EncryptUpdate() with a partial block then a length check can overflow
47+
resulting in a heap corruption. Following an analysis of all OpenSSL
48+
internal usage of the EVP_EncryptUpdate() function all usage is one of two
49+
forms. The first form is where the EVP_EncryptUpdate() call is known to be
50+
the first called function after an EVP_EncryptInit(), and therefore that
51+
specific call must be safe. The second form is where the length passed to
52+
EVP_EncryptUpdate() can be seen from the code to be some small value and
53+
therefore there is no possibility of an overflow. Since all instances are
54+
one of these two forms, it is believed that there can be no overflows in
55+
internal code due to this problem. It should be noted that
56+
EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths.
57+
Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances
58+
of these calls have also been analysed too and it is believed there are no
59+
instances in internal usage where an overflow could occur.
60+
61+
This issue was reported by Guido Vranken.
62+
(CVE-2016-2106)
63+
[Matt Caswell]
64+
65+
*) Prevent ASN.1 BIO excessive memory allocation
66+
67+
When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio()
68+
a short invalid encoding can casuse allocation of large amounts of memory
69+
potentially consuming excessive resources or exhausting memory.
70+
71+
Any application parsing untrusted data through d2i BIO functions is
72+
affected. The memory based functions such as d2i_X509() are *not* affected.
73+
Since the memory based functions are used by the TLS library, TLS
74+
applications are not affected.
75+
76+
This issue was reported by Brian Carpenter.
77+
(CVE-2016-2109)
78+
[Stephen Henson]
79+
80+
*) EBCDIC overread
81+
82+
ASN1 Strings that are over 1024 bytes can cause an overread in applications
83+
using the X509_NAME_oneline() function on EBCDIC systems. This could result
84+
in arbitrary stack data being returned in the buffer.
85+
86+
This issue was reported by Guido Vranken.
87+
(CVE-2016-2176)
88+
[Matt Caswell]
89+
90+
*) Modify behavior of ALPN to invoke callback after SNI/servername
91+
callback, such that updates to the SSL_CTX affect ALPN.
92+
[Todd Short]
93+
94+
*) Remove LOW from the DEFAULT cipher list. This removes singles DES from the
95+
default.
96+
[Kurt Roeckx]
97+
98+
*) Only remove the SSLv2 methods with the no-ssl2-method option. When the
99+
methods are enabled and ssl2 is disabled the methods return NULL.
100+
[Kurt Roeckx]
101+
5102
Changes between 1.0.1r and 1.0.1s [1 Mar 2016]
6103

7104
* Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.

deps/openssl/openssl/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Makefile for OpenSSL
55
##
66

7-
VERSION=1.0.1r
7+
VERSION=1.0.1t
88
MAJOR=1
99
MINOR=0.1
1010
SHLIB_VERSION_NUMBER=1.0.0
@@ -13,7 +13,7 @@ SHLIB_MAJOR=1
1313
SHLIB_MINOR=0.0
1414
SHLIB_EXT=
1515
PLATFORM=dist
16-
OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-store no-unit-test no-zlib no-zlib-dynamic static-engine
16+
OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine
1717
CONFIGURE_ARGS=dist
1818
SHLIB_TARGET=
1919

@@ -61,7 +61,7 @@ OPENSSLDIR=/usr/local/ssl
6161

6262
CC= cc
6363
CFLAG= -O
64-
DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST
64+
DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS
6565
PEX_LIBS=
6666
EX_LIBS=
6767
EXE_EXT=

deps/openssl/openssl/Makefile.bak

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
## Makefile for OpenSSL
55
##
66

7-
VERSION=1.0.1r-dev
7+
VERSION=1.0.1t
88
MAJOR=1
99
MINOR=0.1
1010
SHLIB_VERSION_NUMBER=1.0.0
1111
SHLIB_VERSION_HISTORY=
1212
SHLIB_MAJOR=1
1313
SHLIB_MINOR=0.0
14-
SHLIB_EXT=
15-
PLATFORM=gcc
16-
OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-store no-unit-test no-zlib no-zlib-dynamic static-engine
17-
CONFIGURE_ARGS=gcc
18-
SHLIB_TARGET=
14+
SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
15+
PLATFORM=linux-x86_64
16+
OPTIONS=-Wa,--noexecstack no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl2 no-store no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic static-engine
17+
CONFIGURE_ARGS=linux-x86_64 -Wa,--noexecstack
18+
SHLIB_TARGET=linux-shared
1919

2020
# HERE indicates where this Makefile lives. This can be used to indicate
2121
# where sub-Makefiles are expected to be. Currently has very limited usage,
@@ -60,10 +60,10 @@ OPENSSLDIR=/usr/local/ssl
6060
# PKCS1_CHECK - pkcs1 tests.
6161

6262
CC= gcc
63-
CFLAG= -O3
64-
DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST
63+
CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
64+
DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS
6565
PEX_LIBS=
66-
EX_LIBS=
66+
EX_LIBS= -ldl
6767
EXE_EXT=
6868
ARFLAGS=
6969
AR= ar $(ARFLAGS) r
@@ -88,22 +88,22 @@ ASFLAG=$(CFLAG)
8888
PROCESSOR=
8989

9090
# CPUID module collects small commonly used assembler snippets
91-
CPUID_OBJ= mem_clr.o
92-
BN_ASM= bn_asm.o
91+
CPUID_OBJ= x86_64cpuid.o
92+
BN_ASM= x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o
9393
DES_ENC= des_enc.o fcrypt_b.o
94-
AES_ENC= aes_core.o aes_cbc.o
94+
AES_ENC= aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o
9595
BF_ENC= bf_enc.o
9696
CAST_ENC= c_enc.o
97-
RC4_ENC= rc4_enc.o rc4_skey.o
97+
RC4_ENC= rc4-x86_64.o rc4-md5-x86_64.o
9898
RC5_ENC= rc5_enc.o
99-
MD5_ASM_OBJ=
100-
SHA1_ASM_OBJ=
99+
MD5_ASM_OBJ= md5-x86_64.o
100+
SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
101101
RMD160_ASM_OBJ=
102-
WP_ASM_OBJ= wp_block.o
103-
CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o
104-
MODES_ASM_OBJ=
102+
WP_ASM_OBJ= wp-x86_64.o
103+
CMLL_ENC= cmll-x86_64.o cmll_misc.o
104+
MODES_ASM_OBJ= ghash-x86_64.o
105105
ENGINES_ASM_OBJ=
106-
PERLASM_SCHEME=
106+
PERLASM_SCHEME= elf
107107

108108
# KRB5 stuff
109109
KRB5_INCLUDES=
@@ -175,8 +175,8 @@ LIBS= libcrypto.a libssl.a
175175
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
176176
SHARED_SSL=libssl$(SHLIB_EXT)
177177
SHARED_LIBS=
178-
SHARED_LIBS_LINK_EXTS=
179-
SHARED_LDFLAGS=
178+
SHARED_LIBS_LINK_EXTS=.so.$(SHLIB_MAJOR) .so
179+
SHARED_LDFLAGS=-m64
180180

181181
GENERAL= Makefile
182182
BASENAME= openssl

deps/openssl/openssl/NEWS

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
This file gives a brief overview of the major changes between each OpenSSL
66
release. For more details please read the CHANGES file.
77

8+
Major changes between OpenSSL 1.0.1s and OpenSSL 1.0.1t [3 May 2016]
9+
10+
o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107)
11+
o Fix EVP_EncodeUpdate overflow (CVE-2016-2105)
12+
o Fix EVP_EncryptUpdate overflow (CVE-2016-2106)
13+
o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109)
14+
o EBCDIC overread (CVE-2016-2176)
15+
o Modify behavior of ALPN to invoke callback after SNI/servername
16+
callback, such that updates to the SSL_CTX affect ALPN.
17+
o Remove LOW from the DEFAULT cipher list. This removes singles DES from
18+
the default.
19+
o Only remove the SSLv2 methods with the no-ssl2-method option.
20+
821
Major changes between OpenSSL 1.0.1r and OpenSSL 1.0.1s [1 Mar 2016]
922

1023
o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.

deps/openssl/openssl/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OpenSSL 1.0.1s 1 Mar 2016
2+
OpenSSL 1.0.1t 3 May 2016
33

44
Copyright (c) 1998-2015 The OpenSSL Project
55
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson

deps/openssl/openssl/apps/app_rand.c

+4-10
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,10 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
124124
char buffer[200];
125125

126126
#ifdef OPENSSL_SYS_WINDOWS
127-
/*
128-
* allocate 2 to dont_warn not to use RAND_screen() via
129-
* -no_rand_screen option in s_client
130-
*/
131-
if (dont_warn != 2) {
132-
BIO_printf(bio_e, "Loading 'screen' into random state -");
133-
BIO_flush(bio_e);
134-
RAND_screen();
135-
BIO_printf(bio_e, " done\n");
136-
}
127+
BIO_printf(bio_e, "Loading 'screen' into random state -");
128+
BIO_flush(bio_e);
129+
RAND_screen();
130+
BIO_printf(bio_e, " done\n");
137131
#endif
138132

139133
if (file == NULL)

deps/openssl/openssl/apps/pkcs7.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,16 @@ int MAIN(int argc, char **argv)
235235
i = OBJ_obj2nid(p7->type);
236236
switch (i) {
237237
case NID_pkcs7_signed:
238-
certs = p7->d.sign->cert;
239-
crls = p7->d.sign->crl;
238+
if (p7->d.sign != NULL) {
239+
certs = p7->d.sign->cert;
240+
crls = p7->d.sign->crl;
241+
}
240242
break;
241243
case NID_pkcs7_signedAndEnveloped:
242-
certs = p7->d.signed_and_enveloped->cert;
243-
crls = p7->d.signed_and_enveloped->crl;
244+
if (p7->d.signed_and_enveloped != NULL) {
245+
certs = p7->d.signed_and_enveloped->cert;
246+
crls = p7->d.signed_and_enveloped->crl;
247+
}
244248
break;
245249
default:
246250
break;

deps/openssl/openssl/apps/s_client.c

+8-23
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,6 @@ typedef unsigned int u_int;
180180
# include <fcntl.h>
181181
#endif
182182

183-
/* Use Windows API with STD_INPUT_HANDLE when checking for input?
184-
Don't look at OPENSSL_SYS_MSDOS for this, since it is always defined if
185-
OPENSSL_SYS_WINDOWS is defined */
186-
#if defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_WINCE) && defined(STD_INPUT_HANDLE)
187-
#define OPENSSL_USE_STD_INPUT_HANDLE
188-
#endif
189-
190183
#undef PROG
191184
#define PROG s_client_main
192185

@@ -233,7 +226,6 @@ static int ocsp_resp_cb(SSL *s, void *arg);
233226
static BIO *bio_c_out = NULL;
234227
static int c_quiet = 0;
235228
static int c_ign_eof = 0;
236-
static int c_no_rand_screen = 0;
237229

238230
#ifndef OPENSSL_NO_PSK
239231
/* Default PSK identity and key */
@@ -436,10 +428,6 @@ static void sc_usage(void)
436428
" -keymatexport label - Export keying material using label\n");
437429
BIO_printf(bio_err,
438430
" -keymatexportlen len - Export len bytes of keying material (default 20)\n");
439-
#ifdef OPENSSL_SYS_WINDOWS
440-
BIO_printf(bio_err,
441-
" -no_rand_screen - Do not use RAND_screen() to initialize random state\n");
442-
#endif
443431
}
444432

445433
#ifndef OPENSSL_NO_TLSEXT
@@ -1016,10 +1004,6 @@ int MAIN(int argc, char **argv)
10161004
keymatexportlen = atoi(*(++argv));
10171005
if (keymatexportlen == 0)
10181006
goto bad;
1019-
#ifdef OPENSSL_SYS_WINDOWS
1020-
} else if (strcmp(*argv, "-no_rand_screen") == 0) {
1021-
c_no_rand_screen = 1;
1022-
#endif
10231007
} else {
10241008
BIO_printf(bio_err, "unknown option %s\n", *argv);
10251009
badop = 1;
@@ -1103,7 +1087,7 @@ int MAIN(int argc, char **argv)
11031087
}
11041088
}
11051089
1106-
if (!app_RAND_load_file(NULL, bio_err, ++c_no_rand_screen) && inrand == NULL
1090+
if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL
11071091
&& !RAND_status()) {
11081092
BIO_printf(bio_err,
11091093
"warning, not much extra random data, consider using the -rand option\n");
@@ -1600,16 +1584,17 @@ int MAIN(int argc, char **argv)
16001584
tv.tv_usec = 0;
16011585
i = select(width, (void *)&readfds, (void *)&writefds,
16021586
NULL, &tv);
1603-
#if defined(OPENSSL_USE_STD_INPUT_HANDLE)
1587+
# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1588+
if (!i && (!_kbhit() || !read_tty))
1589+
continue;
1590+
# else
16041591
if (!i && (!((_kbhit())
16051592
|| (WAIT_OBJECT_0 ==
16061593
WaitForSingleObject(GetStdHandle
16071594
(STD_INPUT_HANDLE),
16081595
0)))
16091596
|| !read_tty))
16101597
continue;
1611-
#else
1612-
if(!i && (!_kbhit() || !read_tty) ) continue;
16131598
# endif
16141599
} else
16151600
i = select(width, (void *)&readfds, (void *)&writefds,
@@ -1808,12 +1793,12 @@ int MAIN(int argc, char **argv)
18081793
}
18091794
}
18101795
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
1811-
#if defined(OPENSSL_USE_STD_INPUT_HANDLE)
1796+
# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1797+
else if (_kbhit())
1798+
# else
18121799
else if ((_kbhit())
18131800
|| (WAIT_OBJECT_0 ==
18141801
WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
1815-
#else
1816-
else if (_kbhit())
18171802
# endif
18181803
#elif defined (OPENSSL_SYS_NETWARE)
18191804
else if (_kbhit())

deps/openssl/openssl/crypto/asn1/a_bytes.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
200200
} else {
201201
if (len != 0) {
202202
if ((ret->length < len) || (ret->data == NULL)) {
203-
if (ret->data != NULL)
204-
OPENSSL_free(ret->data);
205203
s = (unsigned char *)OPENSSL_malloc((int)len + 1);
206204
if (s == NULL) {
207205
i = ERR_R_MALLOC_FAILURE;
208206
goto err;
209207
}
208+
if (ret->data != NULL)
209+
OPENSSL_free(ret->data);
210210
} else
211211
s = ret->data;
212212
memcpy(s, p, (int)len);

0 commit comments

Comments
 (0)