Skip to content

Commit 1cf8ef4

Browse files
committed
Merge remote-tracking branch 'upstream/OpenSSL_1_0_2-stable' into 1.0.2-chacha
2 parents b5caa78 + 09b894b commit 1cf8ef4

Some content is hidden

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

76 files changed

+483
-373
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ compiler:
1414

1515
script:
1616
- ./config enable-static-engine enable-ec_nistp_64_gcc_128 enable-gost enable-idea enable-md2 enable-rc5 enable-rfc3779 enable-ssl-trace enable-ssl2 enable-ssl3 enable-zlib experimental-jpake no-zlib-dynamic 1>/dev/null && make depend 1>/dev/null && make 1>/dev/null && make test
17+

CHANGES

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,48 @@
22
OpenSSL CHANGES
33
_______________
44

5-
Changes between 1.0.2i and 1.0.2j [xx XXX xxxx]
5+
Changes between 1.0.2j and 1.0.2k [xx XXX xxxx]
6+
7+
*) Montgomery multiplication may produce incorrect results
8+
9+
There is a carry propagating bug in the Broadwell-specific Montgomery
10+
multiplication procedure that handles input lengths divisible by, but
11+
longer than 256 bits. Analysis suggests that attacks against RSA, DSA
12+
and DH private keys are impossible. This is because the subroutine in
13+
question is not used in operations with the private key itself and an input
14+
of the attacker's direct choice. Otherwise the bug can manifest itself as
15+
transient authentication and key negotiation failures or reproducible
16+
erroneous outcome of public-key operations with specially crafted input.
17+
Among EC algorithms only Brainpool P-512 curves are affected and one
18+
presumably can attack ECDH key negotiation. Impact was not analyzed in
19+
detail, because pre-requisites for attack are considered unlikely. Namely
20+
multiple clients have to choose the curve in question and the server has to
21+
share the private key among them, neither of which is default behaviour.
22+
Even then only clients that chose the curve will be affected.
23+
24+
This issue was publicly reported as transient failures and was not
25+
initially recognized as a security issue. Thanks to Richard Morgan for
26+
providing reproducible case.
27+
(CVE-2016-7055)
28+
[Andy Polyakov]
29+
30+
*) OpenSSL now fails if it receives an unrecognised record type in TLS1.0
31+
or TLS1.1. Previously this only happened in SSLv3 and TLS1.2. This is to
32+
prevent issues where no progress is being made and the peer continually
33+
sends unrecognised record types, using up resources processing them.
34+
[Matt Caswell]
35+
36+
Changes between 1.0.2i and 1.0.2j [26 Sep 2016]
637

7-
*)
38+
*) Missing CRL sanity check
39+
40+
A bug fix which included a CRL sanity check was added to OpenSSL 1.1.0
41+
but was omitted from OpenSSL 1.0.2i. As a result any attempt to use
42+
CRLs in OpenSSL 1.0.2i will crash with a null pointer exception.
43+
44+
This issue only affects the OpenSSL 1.0.2i
45+
(CVE-2016-7052)
46+
[Matt Caswell]
847

948
Changes between 1.0.2h and 1.0.2i [22 Sep 2016]
1049

CONTRIBUTING

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HOW TO CONTRIBUTE TO PATCHES OpenSSL
1+
HOW TO CONTRIBUTE PATCHES TO OpenSSL
22
------------------------------------
33

44
(Please visit https://www.openssl.org/community/getting-started.html for
@@ -11,34 +11,12 @@ OpenSSL community you might want to discuss it on the openssl-dev mailing
1111
list first. Someone may be already working on the same thing or there
1212
may be a good reason as to why that feature isn't implemented.
1313

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.
14+
To submit a patch, make a pull request on GitHub. If you think the patch
15+
could use feedback from the community, please start a thread on openssl-dev
16+
to discuss it.
1817

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:
24-
25-
% git format-patch --stdout HEAD^ >mydiffs.patch
26-
27-
Another method of creating an acceptable patch file without using git is as
28-
follows:
29-
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:
18+
Having addressed the following items before the PR will help make the
19+
acceptance and review process faster:
4220

4321
1. Anything other than trivial contributions will require a contributor
4422
licensing agreement, giving us permission to use your code. See
@@ -55,21 +33,22 @@ the acceptance and review process faster:
5533
in the file LICENSE in the source distribution or at
5634
https://www.openssl.org/source/license.html
5735

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.
36+
3. Patches should be as current as possible; expect to have to rebase
37+
often. We do not accept merge commits; You will be asked to remove
38+
them before a patch is considered acceptable.
6239

6340
4. Patches should follow our coding style (see
6441
https://www.openssl.org/policies/codingstyle.html) and compile without
6542
warnings. Where gcc or clang is availble you should use the
6643
--strict-warnings Configure option. OpenSSL compiles on many varied
6744
platforms: try to ensure you only use portable features.
45+
Clean builds via Travis and AppVeyor are expected, and done whenever
46+
a PR is created or updated.
6847

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.
48+
5. When at all possible, patches should include tests. These can
49+
either be added to an existing test, or completely new. Please see
50+
test/README for information on the test framework.
7251

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.
52+
6. New features or changed functionality must include
53+
documentation. Please look at the "pod" files in doc/apps, doc/crypto
54+
and doc/ssl for examples of our style.

Configure

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ eval 'exec perl -S $0 ${1+"$@"}'
77

88
require 5.000;
99
use strict;
10+
use File::Compare;
1011

1112
# see INSTALL for instructions.
1213

@@ -1812,8 +1813,16 @@ while (<IN>)
18121813
}
18131814
close(IN);
18141815
close(OUT);
1815-
rename($Makefile,"$Makefile.bak") || die "unable to rename $Makefile\n" if -e $Makefile;
1816-
rename("$Makefile.new",$Makefile) || die "unable to rename $Makefile.new\n";
1816+
if ((compare($Makefile, "$Makefile.new"))
1817+
or file_newer('Configure', $Makefile)
1818+
or file_newer('config', $Makefile)
1819+
or file_newer('Makefile.org', $Makefile))
1820+
{
1821+
rename($Makefile,"$Makefile.bak") || die "unable to rename $Makefile\n" if -e $Makefile;
1822+
rename("$Makefile.new",$Makefile) || die "unable to rename $Makefile.new\n";
1823+
}
1824+
else
1825+
{ unlink("$Makefile.new"); }
18171826

18181827
print "CC =$cc\n";
18191828
print "CFLAG =$cflags\n";
@@ -2007,9 +2016,13 @@ print OUT "#ifdef __cplusplus\n";
20072016
print OUT "}\n";
20082017
print OUT "#endif\n";
20092018
close(OUT);
2010-
rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h";
2011-
rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n";
2012-
2019+
if (compare("crypto/opensslconf.h.new","crypto/opensslconf.h"))
2020+
{
2021+
rename("crypto/opensslconf.h","crypto/opensslconf.h.bak") || die "unable to rename crypto/opensslconf.h\n" if -e "crypto/opensslconf.h";
2022+
rename("crypto/opensslconf.h.new","crypto/opensslconf.h") || die "unable to rename crypto/opensslconf.h.new\n";
2023+
}
2024+
else
2025+
{ unlink("crypto/opensslconf.h.new"); }
20132026

20142027
# Fix the date
20152028

@@ -2314,3 +2327,9 @@ sub test_sanity
23142327
print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
23152328
return $errorcnt;
23162329
}
2330+
2331+
sub file_newer
2332+
{
2333+
my ($file1, $file2) = @_;
2334+
return (stat($file1))[9] > (stat($file2))[9]
2335+
}

INSTALL

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,18 @@
159159
OpenSSL binary ("openssl"). The libraries will be built in the top-level
160160
directory, and the binary will be in the "apps" directory.
161161

162-
If "make" fails, look at the output. There may be reasons for
163-
the failure that aren't problems in OpenSSL itself (like missing
164-
standard headers). If it is a problem with OpenSSL itself, please
165-
report the problem to <openssl-[email protected]> (note that your
166-
message will be recorded in the request tracker publicly readable
167-
at https://www.openssl.org/community/index.html#bugs and will be
168-
forwarded to a public mailing list). Include the output of "make
169-
report" in your message. Please check out the request tracker. Maybe
170-
the bug was already reported or has already been fixed.
171-
172-
[If you encounter assembler error messages, try the "no-asm"
173-
configuration option as an immediate fix.]
162+
If the build fails, look at the output. There may be reasons
163+
for the failure that aren't problems in OpenSSL itself (like
164+
missing standard headers). If you are having problems you can
165+
get help by sending an email to the openssl-users email list (see
166+
https://www.openssl.org/community/mailinglists.html for details). If
167+
it is a bug with OpenSSL itself, please open an issue on GitHub, at
168+
https://github.com/openssl/openssl/issues. Please review the existing
169+
ones first; maybe the bug was already reported or has already been
170+
fixed.
171+
172+
(If you encounter assembler error messages, try the "no-asm"
173+
configuration option as an immediate fix.)
174174

175175
Compiling parts of OpenSSL with gcc and others with the system
176176
compiler will result in unresolved symbols on some systems.

Makefile.org

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
203203
$${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
204204
$${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
205205
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
206-
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
206+
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} \
207+
$${APPS+APPS}
207208

208209
# LC_ALL=C ensures that error [and other] messages are delivered in
209210
# same language for uniform treatment.

NEWS

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
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.2i and OpenSSL 1.0.2j [under development]
8+
Major changes between OpenSSL 1.0.2j and OpenSSL 1.0.2k [under development]
99

10-
o
10+
o Montgomery multiplication may produce incorrect results (CVE-2016-7055)
11+
12+
Major changes between OpenSSL 1.0.2i and OpenSSL 1.0.2j [26 Sep 2016]
13+
14+
o Missing CRL sanity check (CVE-2016-7052)
1115

1216
Major changes between OpenSSL 1.0.2h and OpenSSL 1.0.2i [22 Sep 2016]
1317

README

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OpenSSL 1.0.2j-dev
2+
OpenSSL 1.0.2k-dev
33

44
Copyright (c) 1998-2015 The OpenSSL Project
55
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
@@ -66,13 +66,13 @@
6666
If you have any problems with OpenSSL then please take the following steps
6767
first:
6868

69-
- Download the current snapshot from ftp://ftp.openssl.org/snapshot/
69+
- Download the latest version from the repository
7070
to see if the problem has already been addressed
71-
- Remove ASM versions of libraries
71+
- Configure with no-asm
7272
- Remove compiler optimisation flags
7373

74-
If you wish to report a bug then please include the following information in
75-
any bug report:
74+
If you wish to report a bug then please include the following information
75+
and create an issue on GitHub:
7676

7777
- On Unix systems:
7878
Self-test report generated by 'make report'
@@ -84,27 +84,9 @@
8484
- Problem Description (steps that will reproduce the problem, if known)
8585
- Stack Traceback (if the application dumps core)
8686

87-
Email the report to:
88-
89-
90-
91-
In order to avoid spam, this is a moderated mailing list, and it might
92-
take a day for the ticket to show up. (We also scan posts to make sure
93-
that security disclosures aren't publically posted by mistake.) Mail
94-
to this address is recorded in the public RT (request tracker) database
95-
(see https://www.openssl.org/community/index.html#bugs for details) and
96-
also forwarded the public openssl-dev mailing list. Confidential mail
97-
may be sent to [email protected] (PGP key available from the
98-
key servers).
99-
100-
Please do NOT use this for general assistance or support queries.
10187
Just because something doesn't work the way you expect does not mean it
10288
is necessarily a bug in OpenSSL.
10389

104-
You can also make GitHub pull requests. If you do this, please also send
105-
mail to [email protected] with a link to the PR so that we can more easily
106-
keep track of it.
107-
10890
HOW TO CONTRIBUTE TO OpenSSL
10991
----------------------------
11092

@@ -113,7 +95,7 @@
11395
LEGALITIES
11496
----------
11597

116-
A number of nations, in particular the U.S., restrict the use or export
117-
of cryptography. If you are potentially subject to such restrictions
118-
you should seek competent professional legal advice before attempting to
119-
develop or distribute cryptographic code.
98+
A number of nations restrict the use or export of cryptography. If you
99+
are potentially subject to such restrictions you should seek competent
100+
professional legal advice before attempting to develop or distribute
101+
cryptographic code.

apps/apps.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,10 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
972972
if (!e)
973973
BIO_printf(err, "no engine specified\n");
974974
else {
975-
pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
975+
if (ENGINE_init(e)) {
976+
pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
977+
ENGINE_finish(e);
978+
}
976979
if (!pkey) {
977980
BIO_printf(err, "cannot load %s from engine\n", key_descrip);
978981
ERR_print_errors(err);
@@ -1532,11 +1535,13 @@ static ENGINE *try_load_engine(BIO *err, const char *engine, int debug)
15321535
}
15331536
return e;
15341537
}
1538+
#endif
15351539

15361540
ENGINE *setup_engine(BIO *err, const char *engine, int debug)
15371541
{
15381542
ENGINE *e = NULL;
15391543

1544+
#ifndef OPENSSL_NO_ENGINE
15401545
if (engine) {
15411546
if (strcmp(engine, "auto") == 0) {
15421547
BIO_printf(err, "enabling auto ENGINE support\n");
@@ -1561,13 +1566,19 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug)
15611566
}
15621567

15631568
BIO_printf(err, "engine \"%s\" set.\n", ENGINE_get_id(e));
1564-
1565-
/* Free our "structural" reference. */
1566-
ENGINE_free(e);
15671569
}
1570+
#endif
15681571
return e;
15691572
}
1573+
1574+
void release_engine(ENGINE *e)
1575+
{
1576+
#ifndef OPENSSL_NO_ENGINE
1577+
if (e != NULL)
1578+
/* Free our "structural" reference. */
1579+
ENGINE_free(e);
15701580
#endif
1581+
}
15711582

15721583
int load_config(BIO *err, CONF *cnf)
15731584
{

apps/apps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
259259
const char *pass, ENGINE *e,
260260
const char *cert_descrip);
261261
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
262-
# ifndef OPENSSL_NO_ENGINE
262+
263263
ENGINE *setup_engine(BIO *err, const char *engine, int debug);
264-
# endif
264+
void release_engine(ENGINE *e);
265265

266266
# ifndef OPENSSL_NO_OCSP
267267
OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,

0 commit comments

Comments
 (0)