Skip to content

Commit ea31f50

Browse files
shigekijasnell
authored andcommitted
deps: upgrade openssl sources to 1.0.2i
This replaces all sources of openssl-1.0.2i.tar.gz into deps/openssl/openssl PR-URL: #8714 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 5adfb31 commit ea31f50

File tree

321 files changed

+5881
-39962
lines changed

Some content is hidden

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

321 files changed

+5881
-39962
lines changed

deps/openssl/openssl/CHANGES

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,166 @@
22
OpenSSL CHANGES
33
_______________
44

5+
Changes between 1.0.2h and 1.0.2i [22 Sep 2016]
6+
7+
*) OCSP Status Request extension unbounded memory growth
8+
9+
A malicious client can send an excessively large OCSP Status Request
10+
extension. If that client continually requests renegotiation, sending a
11+
large OCSP Status Request extension each time, then there will be unbounded
12+
memory growth on the server. This will eventually lead to a Denial Of
13+
Service attack through memory exhaustion. Servers with a default
14+
configuration are vulnerable even if they do not support OCSP. Builds using
15+
the "no-ocsp" build time option are not affected.
16+
17+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
18+
(CVE-2016-6304)
19+
[Matt Caswell]
20+
21+
*) In order to mitigate the SWEET32 attack, the DES ciphers were moved from
22+
HIGH to MEDIUM.
23+
24+
This issue was reported to OpenSSL Karthikeyan Bhargavan and Gaetan
25+
Leurent (INRIA)
26+
(CVE-2016-2183)
27+
[Rich Salz]
28+
29+
*) OOB write in MDC2_Update()
30+
31+
An overflow can occur in MDC2_Update() either if called directly or
32+
through the EVP_DigestUpdate() function using MDC2. If an attacker
33+
is able to supply very large amounts of input data after a previous
34+
call to EVP_EncryptUpdate() with a partial block then a length check
35+
can overflow resulting in a heap corruption.
36+
37+
The amount of data needed is comparable to SIZE_MAX which is impractical
38+
on most platforms.
39+
40+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
41+
(CVE-2016-6303)
42+
[Stephen Henson]
43+
44+
*) Malformed SHA512 ticket DoS
45+
46+
If a server uses SHA512 for TLS session ticket HMAC it is vulnerable to a
47+
DoS attack where a malformed ticket will result in an OOB read which will
48+
ultimately crash.
49+
50+
The use of SHA512 in TLS session tickets is comparatively rare as it requires
51+
a custom server callback and ticket lookup mechanism.
52+
53+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
54+
(CVE-2016-6302)
55+
[Stephen Henson]
56+
57+
*) OOB write in BN_bn2dec()
58+
59+
The function BN_bn2dec() does not check the return value of BN_div_word().
60+
This can cause an OOB write if an application uses this function with an
61+
overly large BIGNUM. This could be a problem if an overly large certificate
62+
or CRL is printed out from an untrusted source. TLS is not affected because
63+
record limits will reject an oversized certificate before it is parsed.
64+
65+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
66+
(CVE-2016-2182)
67+
[Stephen Henson]
68+
69+
*) OOB read in TS_OBJ_print_bio()
70+
71+
The function TS_OBJ_print_bio() misuses OBJ_obj2txt(): the return value is
72+
the total length the OID text representation would use and not the amount
73+
of data written. This will result in OOB reads when large OIDs are
74+
presented.
75+
76+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
77+
(CVE-2016-2180)
78+
[Stephen Henson]
79+
80+
*) Pointer arithmetic undefined behaviour
81+
82+
Avoid some undefined pointer arithmetic
83+
84+
A common idiom in the codebase is to check limits in the following manner:
85+
"p + len > limit"
86+
87+
Where "p" points to some malloc'd data of SIZE bytes and
88+
limit == p + SIZE
89+
90+
"len" here could be from some externally supplied data (e.g. from a TLS
91+
message).
92+
93+
The rules of C pointer arithmetic are such that "p + len" is only well
94+
defined where len <= SIZE. Therefore the above idiom is actually
95+
undefined behaviour.
96+
97+
For example this could cause problems if some malloc implementation
98+
provides an address for "p" such that "p + len" actually overflows for
99+
values of len that are too big and therefore p + len < limit.
100+
101+
This issue was reported to OpenSSL by Guido Vranken
102+
(CVE-2016-2177)
103+
[Matt Caswell]
104+
105+
*) Constant time flag not preserved in DSA signing
106+
107+
Operations in the DSA signing algorithm should run in constant time in
108+
order to avoid side channel attacks. A flaw in the OpenSSL DSA
109+
implementation means that a non-constant time codepath is followed for
110+
certain operations. This has been demonstrated through a cache-timing
111+
attack to be sufficient for an attacker to recover the private DSA key.
112+
113+
This issue was reported by César Pereida (Aalto University), Billy Brumley
114+
(Tampere University of Technology), and Yuval Yarom (The University of
115+
Adelaide and NICTA).
116+
(CVE-2016-2178)
117+
[César Pereida]
118+
119+
*) DTLS buffered message DoS
120+
121+
In a DTLS connection where handshake messages are delivered out-of-order
122+
those messages that OpenSSL is not yet ready to process will be buffered
123+
for later use. Under certain circumstances, a flaw in the logic means that
124+
those messages do not get removed from the buffer even though the handshake
125+
has been completed. An attacker could force up to approx. 15 messages to
126+
remain in the buffer when they are no longer required. These messages will
127+
be cleared when the DTLS connection is closed. The default maximum size for
128+
a message is 100k. Therefore the attacker could force an additional 1500k
129+
to be consumed per connection. By opening many simulataneous connections an
130+
attacker could cause a DoS attack through memory exhaustion.
131+
132+
This issue was reported to OpenSSL by Quan Luo.
133+
(CVE-2016-2179)
134+
[Matt Caswell]
135+
136+
*) DTLS replay protection DoS
137+
138+
A flaw in the DTLS replay attack protection mechanism means that records
139+
that arrive for future epochs update the replay protection "window" before
140+
the MAC for the record has been validated. This could be exploited by an
141+
attacker by sending a record for the next epoch (which does not have to
142+
decrypt or have a valid MAC), with a very large sequence number. This means
143+
that all subsequent legitimate packets are dropped causing a denial of
144+
service for a specific DTLS connection.
145+
146+
This issue was reported to OpenSSL by the OCAP audit team.
147+
(CVE-2016-2181)
148+
[Matt Caswell]
149+
150+
*) Certificate message OOB reads
151+
152+
In OpenSSL 1.0.2 and earlier some missing message length checks can result
153+
in OOB reads of up to 2 bytes beyond an allocated buffer. There is a
154+
theoretical DoS risk but this has not been observed in practice on common
155+
platforms.
156+
157+
The messages affected are client certificate, client certificate request
158+
and server certificate. As a result the attack can only be performed
159+
against a client or a server which enables client authentication.
160+
161+
This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
162+
(CVE-2016-6306)
163+
[Stephen Henson]
164+
5165
Changes between 1.0.2g and 1.0.2h [3 May 2016]
6166

7167
*) Prevent padding oracle in AES-NI CBC MAC check
@@ -8669,7 +8829,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
86698829

86708830
*) Source code cleanups: use const where appropriate, eliminate casts,
86718831
use void * instead of char * in lhash.
8672-
[Ulf Möller]
8832+
[Ulf Möller]
86738833

86748834
*) Bugfix: ssl3_send_server_key_exchange was not restartable
86758835
(the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of

deps/openssl/openssl/CONTRIBUTING

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,75 @@
1-
HOW TO CONTRIBUTE TO OpenSSL
2-
----------------------------
1+
HOW TO CONTRIBUTE TO PATCHES OpenSSL
2+
------------------------------------
33

4-
Development is coordinated on the openssl-dev mailing list (see
5-
http://www.openssl.org for information on subscribing). If you
6-
would like to submit a patch, send it to [email protected] with
7-
the string "[PATCH]" in the subject. Please be sure to include a
8-
textual explanation of what your patch does.
9-
10-
You can also make GitHub pull requests. If you do this, please also send
11-
mail to [email protected] with a brief description and a link to the PR so
12-
that we can more easily keep track of it.
4+
(Please visit https://www.openssl.org/community/getting-started.html for
5+
other ideas about how to contribute.)
136

7+
Development is coordinated on the openssl-dev mailing list (see the
8+
above link or https://mta.openssl.org for information on subscribing).
149
If you are unsure as to whether a feature will be useful for the general
15-
OpenSSL community please discuss it on the openssl-dev mailing list first.
16-
Someone may be already working on the same thing or there may be a good
17-
reason as to why that feature isn't implemented.
10+
OpenSSL community you might want to discuss it on the openssl-dev mailing
11+
list first. Someone may be already working on the same thing or there
12+
may be a good reason as to why that feature isn't implemented.
1813

19-
Patches should be as up to date as possible, preferably relative to the
20-
current Git or the last snapshot. They should follow our coding style
21-
(see https://www.openssl.org/policies/codingstyle.html) and compile without
22-
warnings using the --strict-warnings flag. OpenSSL compiles on many varied
23-
platforms: try to ensure you only use portable features.
14+
The best way to submit a patch is to make a pull request on GitHub.
15+
(It is not necessary to send mail to [email protected] to open a ticket!)
16+
If you think the patch could use feedback from the community, please
17+
start a thread on openssl-dev.
2418

25-
Our preferred format for patch files is "git format-patch" output. For example
26-
to provide a patch file containing the last commit in your local git repository
27-
use the following command:
19+
You can also submit patches by sending it as mail to [email protected].
20+
Please include the word "PATCH" and an explanation of what the patch
21+
does in the subject line. If you do this, our preferred format is "git
22+
format-patch" output. For example to provide a patch file containing the
23+
last commit in your local git repository use the following command:
2824

29-
# git format-patch --stdout HEAD^ >mydiffs.patch
25+
% git format-patch --stdout HEAD^ >mydiffs.patch
3026

3127
Another method of creating an acceptable patch file without using git is as
3228
follows:
3329

34-
# cd openssl-work
35-
# [your changes]
36-
# ./Configure dist; make clean
37-
# cd ..
38-
# diff -ur openssl-orig openssl-work > mydiffs.patch
30+
% cd openssl-work
31+
...make your changes...
32+
% ./Configure dist; make clean
33+
% cd ..
34+
% diff -ur openssl-orig openssl-work >mydiffs.patch
35+
36+
Note that pull requests are generally easier for the team, and community, to
37+
work with. Pull requests benefit from all of the standard GitHub features,
38+
including code review tools, simpler integration, and CI build support.
39+
40+
No matter how a patch is submitted, the following items will help make
41+
the acceptance and review process faster:
42+
43+
1. Anything other than trivial contributions will require a contributor
44+
licensing agreement, giving us permission to use your code. See
45+
https://www.openssl.org/policies/cla.html for details.
46+
47+
2. All source files should start with the following text (with
48+
appropriate comment characters at the start of each line and the
49+
year(s) updated):
50+
51+
Copyright 20xx-20yy The OpenSSL Project Authors. All Rights Reserved.
52+
53+
Licensed under the OpenSSL license (the "License"). You may not use
54+
this file except in compliance with the License. You can obtain a copy
55+
in the file LICENSE in the source distribution or at
56+
https://www.openssl.org/source/license.html
57+
58+
3. Patches should be as current as possible. When using GitHub, please
59+
expect to have to rebase and update often. Note that we do not accept merge
60+
commits. You will be asked to remove them before a patch is considered
61+
acceptable.
62+
63+
4. Patches should follow our coding style (see
64+
https://www.openssl.org/policies/codingstyle.html) and compile without
65+
warnings. Where gcc or clang is availble you should use the
66+
--strict-warnings Configure option. OpenSSL compiles on many varied
67+
platforms: try to ensure you only use portable features.
68+
69+
5. When at all possible, patches should include tests. These can either be
70+
added to an existing test, or completely new. Please see test/README
71+
for information on the test framework.
72+
73+
6. New features or changed functionality must include documentation. Please
74+
look at the "pod" files in doc/apps, doc/crypto and doc/ssl for examples of
75+
our style.

deps/openssl/openssl/Configure

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ my @experimental = ();
799799

800800
# This is what $depflags will look like with the above defaults
801801
# (we need this to see if we should advise the user to run "make depend"):
802-
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
802+
my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS";
803803

804804
# Explicit "no-..." options will be collected in %disabled along with the defaults.
805805
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
@@ -1082,11 +1082,6 @@ if (defined($disabled{"md5"}) || defined($disabled{"sha"})
10821082
$disabled{"tls1"} = "forced";
10831083
}
10841084

1085-
if (defined($disabled{"tls1"}))
1086-
{
1087-
$disabled{"tlsext"} = "forced";
1088-
}
1089-
10901085
if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
10911086
|| defined($disabled{"dh"}))
10921087
{
@@ -1254,6 +1249,7 @@ my $shared_extension = $fields[$idx_shared_extension];
12541249
my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib];
12551250
my $ar = $ENV{'AR'} || "ar";
12561251
my $arflags = $fields[$idx_arflags];
1252+
my $windres = $ENV{'RC'} || $ENV{'WINDRES'} || "windres";
12571253
my $multilib = $fields[$idx_multilib];
12581254

12591255
# if $prefix/lib$multilib is not an existing directory, then
@@ -1562,8 +1558,15 @@ $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/);
15621558
$des_obj=$des_enc unless ($des_obj =~ /\.o$/);
15631559
$bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/);
15641560
$cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/);
1565-
$rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/);
15661561
$rc5_obj=$rc5_enc unless ($rc5_obj =~ /\.o$/);
1562+
if ($rc4_obj =~ /\.o$/)
1563+
{
1564+
$cflags.=" -DRC4_ASM";
1565+
}
1566+
else
1567+
{
1568+
$rc4_obj=$rc4_enc;
1569+
}
15671570
if ($sha1_obj =~ /\.o$/)
15681571
{
15691572
# $sha1_obj=$sha1_enc;
@@ -1717,12 +1720,14 @@ while (<IN>)
17171720
s/^AR=\s*/AR= \$\(CROSS_COMPILE\)/;
17181721
s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
17191722
s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
1723+
s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/;
17201724
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
17211725
}
17221726
else {
17231727
s/^CC=.*$/CC= $cc/;
17241728
s/^AR=\s*ar/AR= $ar/;
17251729
s/^RANLIB=.*/RANLIB= $ranlib/;
1730+
s/^RC=.*/RC= $windres/;
17261731
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
17271732
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
17281733
}

deps/openssl/openssl/INSTALL.W32

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,17 @@
300300

301301
If you link with static OpenSSL libraries [those built with ms/nt.mak],
302302
then you're expected to additionally link your application with
303-
WS2_32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing
304-
non-interactive service applications might feel concerned about linking
305-
with the latter two, as they are justly associated with interactive
306-
desktop, which is not available to service processes. The toolkit is
307-
designed to detect in which context it's currently executed, GUI,
308-
console app or service, and act accordingly, namely whether or not to
309-
actually make GUI calls. Additionally those who wish to
310-
/DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and actually keep them
311-
off service process should consider implementing and exporting from
312-
.exe image in question own _OPENSSL_isservice not relying on USER32.DLL.
313-
E.g., on Windows Vista and later you could:
303+
WS2_32.LIB, GDI32.LIB, ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those
304+
developing non-interactive service applications might feel concerned about
305+
linking with GDI32.LIB and USER32.LIB, as they are justly associated with
306+
interactive desktop, which is not available to service processes. The toolkit
307+
is designed to detect in which context it's currently executed, GUI, console
308+
app or service, and act accordingly, namely whether or not to actually make
309+
GUI calls. Additionally those who wish to /DELAYLOAD:GDI32.DLL and
310+
/DELAYLOAD:USER32.DLL and actually keep them off service process should
311+
consider implementing and exporting from .exe image in question own
312+
_OPENSSL_isservice not relying on USER32.DLL. E.g., on Windows Vista and
313+
later you could:
314314

315315
__declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
316316
{ DWORD sess;

0 commit comments

Comments
 (0)