Skip to content

Commit 61ccc27

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 392931b commit 61ccc27

Some content is hidden

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

129 files changed

+884
-37654
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/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

+7-13
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

@@ -1591,16 +1584,17 @@ int MAIN(int argc, char **argv)
15911584
tv.tv_usec = 0;
15921585
i = select(width, (void *)&readfds, (void *)&writefds,
15931586
NULL, &tv);
1594-
#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
15951591
if (!i && (!((_kbhit())
15961592
|| (WAIT_OBJECT_0 ==
15971593
WaitForSingleObject(GetStdHandle
15981594
(STD_INPUT_HANDLE),
15991595
0)))
16001596
|| !read_tty))
16011597
continue;
1602-
#else
1603-
if(!i && (!_kbhit() || !read_tty) ) continue;
16041598
# endif
16051599
} else
16061600
i = select(width, (void *)&readfds, (void *)&writefds,
@@ -1799,12 +1793,12 @@ int MAIN(int argc, char **argv)
17991793
}
18001794
}
18011795
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
1802-
#if defined(OPENSSL_USE_STD_INPUT_HANDLE)
1796+
# if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1797+
else if (_kbhit())
1798+
# else
18031799
else if ((_kbhit())
18041800
|| (WAIT_OBJECT_0 ==
18051801
WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
1806-
#else
1807-
else if (_kbhit())
18081802
# endif
18091803
#elif defined (OPENSSL_SYS_NETWARE)
18101804
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);

deps/openssl/openssl/crypto/asn1/a_d2i_fp.c

+26-10
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
141141
#endif
142142

143143
#define HEADER_SIZE 8
144+
#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
144145
static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
145146
{
146147
BUF_MEM *b;
@@ -217,29 +218,44 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
217218
/* suck in c.slen bytes of data */
218219
want = c.slen;
219220
if (want > (len - off)) {
221+
size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
222+
220223
want -= (len - off);
221224
if (want > INT_MAX /* BIO_read takes an int length */ ||
222225
len + want < len) {
223226
ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ASN1_R_TOO_LONG);
224227
goto err;
225228
}
226-
if (!BUF_MEM_grow_clean(b, len + want)) {
227-
ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE);
228-
goto err;
229-
}
230229
while (want > 0) {
231-
i = BIO_read(in, &(b->data[len]), want);
232-
if (i <= 0) {
233-
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,
234-
ASN1_R_NOT_ENOUGH_DATA);
230+
/*
231+
* Read content in chunks of increasing size
232+
* so we can return an error for EOF without
233+
* having to allocate the entire content length
234+
* in one go.
235+
*/
236+
size_t chunk = want > chunk_max ? chunk_max : want;
237+
238+
if (!BUF_MEM_grow_clean(b, len + chunk)) {
239+
ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE);
235240
goto err;
236241
}
242+
want -= chunk;
243+
while (chunk > 0) {
244+
i = BIO_read(in, &(b->data[len]), chunk);
245+
if (i <= 0) {
246+
ASN1err(ASN1_F_ASN1_D2I_READ_BIO,
247+
ASN1_R_NOT_ENOUGH_DATA);
248+
goto err;
249+
}
237250
/*
238251
* This can't overflow because |len+want| didn't
239252
* overflow.
240253
*/
241-
len += i;
242-
want -= i;
254+
len += i;
255+
chunk -= i;
256+
}
257+
if (chunk_max < INT_MAX/2)
258+
chunk_max *= 2;
243259
}
244260
}
245261
if (off + c.slen < off) {

0 commit comments

Comments
 (0)