Skip to content

Commit 8507f0f

Browse files
danbevMylesBorins
authored andcommitted
deps: upgrade openssl sources to 1.0.2l
This replaces all sources of openssl-1.0.2l.tar.gz into deps/openssl/openssl Fixes: #13161 Backport-PR-URL: #13696 PR-URL: #13233 Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 9bfada8 commit 8507f0f

File tree

215 files changed

+1770
-39189
lines changed

Some content is hidden

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

215 files changed

+1770
-39189
lines changed

deps/openssl/openssl/CHANGES

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

5+
Changes between 1.0.2k and 1.0.2l [25 May 2017]
6+
7+
*) Have 'config' recognise 64-bit mingw and choose 'mingw64' as the target
8+
platform rather than 'mingw'.
9+
[Richard Levitte]
10+
511
Changes between 1.0.2j and 1.0.2k [26 Jan 2017]
612

713
*) Truncated packet could crash via OOB read

deps/openssl/openssl/Configure

+10-9
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
109109
# Minimum warning options... any contributions to OpenSSL should at least get
110110
# past these.
111111

112-
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
112+
my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Wundef -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED";
113113

114114
# TODO(openssl-team): fix problems and investigate if (at least) the following
115115
# warnings can also be enabled:
@@ -2041,12 +2041,13 @@ EOF
20412041
close(OUT);
20422042
} else {
20432043
my $make_command = "$make PERL=\'$perl\'";
2044-
my $make_targets = "";
2045-
$make_targets .= " links" if $symlink;
2046-
$make_targets .= " depend" if $depflags ne $default_depflags && $make_depend;
2047-
$make_targets .= " gentests" if $symlink;
2048-
(system $make_command.$make_targets) == 0 or exit $?
2049-
if $make_targets ne "";
2044+
my @make_targets = ();
2045+
push @make_targets, "links" if $symlink;
2046+
push @make_targets, "depend" if $depflags ne $default_depflags && $make_depend;
2047+
push @make_targets, "gentests" if $symlink;
2048+
foreach my $make_target (@make_targets) {
2049+
(system "$make_command $make_target") == 0 or exit $?;
2050+
}
20502051
if ( $perl =~ m@^/@) {
20512052
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
20522053
&dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
@@ -2056,8 +2057,8 @@ EOF
20562057
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
20572058
}
20582059
if ($depflags ne $default_depflags && !$make_depend) {
2059-
$warn_make_depend++;
2060-
}
2060+
$warn_make_depend++;
2061+
}
20612062
}
20622063

20632064
# create the ms/version32.rc file if needed

deps/openssl/openssl/LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
LICENSE ISSUES
33
==============
44

5-
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
5+
The OpenSSL toolkit stays under a double license, i.e. both the conditions of
66
the OpenSSL License and the original SSLeay license apply to the toolkit.
77
See below for the actual license texts. Actually both licenses are BSD-style
88
Open Source licenses. In case of any license issues related to OpenSSL
@@ -12,7 +12,7 @@
1212
---------------
1313

1414
/* ====================================================================
15-
* Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved.
15+
* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
1616
*
1717
* Redistribution and use in source and binary forms, with or without
1818
* modification, are permitted provided that the following conditions

deps/openssl/openssl/Makefile

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

7-
VERSION=1.0.2k
7+
VERSION=1.0.2l
88
MAJOR=1
99
MINOR=0.2
1010
SHLIB_VERSION_NUMBER=1.0.0
@@ -426,6 +426,14 @@ clean: libclean
426426
rm -fr $$i/*; \
427427
done
428428

429+
distclean: clean
430+
-$(RM) `find . -name .git -prune -o -type l -print`
431+
$(RM) apps/CA.pl
432+
$(RM) test/evptests.txt test/newkey.pem test/testkey.pem test/testreq.pem
433+
$(RM) tools/c_rehash
434+
$(RM) crypto/opensslconf.h
435+
$(RM) Makefile Makefile.bak
436+
429437
makefile.one: files
430438
$(PERL) util/mk1mf.pl >makefile.one; \
431439
sh util/do_ms.sh

deps/openssl/openssl/Makefile.bak

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

7-
VERSION=1.0.2k
7+
VERSION=1.0.2l
88
MAJOR=1
99
MINOR=0.2
1010
SHLIB_VERSION_NUMBER=1.0.0
@@ -426,6 +426,14 @@ clean: libclean
426426
rm -fr $$i/*; \
427427
done
428428

429+
distclean: clean
430+
-$(RM) `find . -name .git -prune -o -type l -print`
431+
$(RM) apps/CA.pl
432+
$(RM) test/evptests.txt test/newkey.pem test/testkey.pem test/testreq.pem
433+
$(RM) tools/c_rehash
434+
$(RM) crypto/opensslconf.h
435+
$(RM) Makefile Makefile.bak
436+
429437
makefile.one: files
430438
$(PERL) util/mk1mf.pl >makefile.one; \
431439
sh util/do_ms.sh

deps/openssl/openssl/Makefile.org

+8
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ clean: libclean
424424
rm -fr $$i/*; \
425425
done
426426

427+
distclean: clean
428+
-$(RM) `find . -name .git -prune -o -type l -print`
429+
$(RM) apps/CA.pl
430+
$(RM) test/evptests.txt test/newkey.pem test/testkey.pem test/testreq.pem
431+
$(RM) tools/c_rehash
432+
$(RM) crypto/opensslconf.h
433+
$(RM) Makefile Makefile.bak
434+
427435
makefile.one: files
428436
$(PERL) util/mk1mf.pl >makefile.one; \
429437
sh util/do_ms.sh

deps/openssl/openssl/NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
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.2k and OpenSSL 1.0.2l [25 May 2017]
9+
10+
o config now recognises 64-bit mingw and chooses mingw64 instead of mingw
11+
812
Major changes between OpenSSL 1.0.2j and OpenSSL 1.0.2k [26 Jan 2017]
913

1014
o Truncated packet could crash via OOB read (CVE-2017-3731)

deps/openssl/openssl/README

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

2-
OpenSSL 1.0.2k 26 Jan 2017
2+
OpenSSL 1.0.2l 25 May 2017
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

+1-10
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,7 @@ 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+
RAND_screen();
137128
#endif
138129

139130
if (file == NULL)

deps/openssl/openssl/apps/ca.c

+11-8
Original file line numberDiff line numberDiff line change
@@ -2126,22 +2126,23 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
21262126
goto err;
21272127
}
21282128

2129-
for (i = 0; i < DB_NUMBER; i++) {
2129+
for (i = 0; i < DB_NUMBER; i++)
21302130
irow[i] = row[i];
2131-
row[i] = NULL;
2132-
}
21332131
irow[DB_NUMBER] = NULL;
21342132

21352133
if (!TXT_DB_insert(db->db, irow)) {
21362134
BIO_printf(bio_err, "failed to update database\n");
21372135
BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
21382136
goto err;
21392137
}
2138+
irow = NULL;
21402139
ok = 1;
21412140
err:
2142-
for (i = 0; i < DB_NUMBER; i++)
2143-
if (row[i] != NULL)
2141+
if (irow != NULL) {
2142+
for (i = 0; i < DB_NUMBER; i++)
21442143
OPENSSL_free(row[i]);
2144+
OPENSSL_free(irow);
2145+
}
21452146

21462147
if (CAname != NULL)
21472148
X509_NAME_free(CAname);
@@ -2396,18 +2397,20 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
23962397
goto err;
23972398
}
23982399

2399-
for (i = 0; i < DB_NUMBER; i++) {
2400+
for (i = 0; i < DB_NUMBER; i++)
24002401
irow[i] = row[i];
2401-
row[i] = NULL;
2402-
}
24032402
irow[DB_NUMBER] = NULL;
24042403

24052404
if (!TXT_DB_insert(db->db, irow)) {
24062405
BIO_printf(bio_err, "failed to update database\n");
24072406
BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
2407+
OPENSSL_free(irow);
24082408
goto err;
24092409
}
24102410

2411+
for (i = 0; i < DB_NUMBER; i++)
2412+
row[i] = NULL;
2413+
24112414
/* Revoke Certificate */
24122415
if (type == -1)
24132416
ok = 1;

deps/openssl/openssl/apps/dhparam.c

+18-6
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,19 @@ int MAIN(int argc, char **argv)
381381
} else
382382
# endif
383383
{
384-
if (informat == FORMAT_ASN1)
384+
if (informat == FORMAT_ASN1) {
385+
/*
386+
* We have no PEM header to determine what type of DH params it
387+
* is. We'll just try both.
388+
*/
385389
dh = d2i_DHparams_bio(in, NULL);
386-
else /* informat == FORMAT_PEM */
390+
/* BIO_reset() returns 0 for success for file BIOs only!!! */
391+
if (dh == NULL && BIO_reset(in) == 0)
392+
dh = d2i_DHxparams_bio(in, NULL);
393+
} else {
394+
/* informat == FORMAT_PEM */
387395
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
396+
}
388397

389398
if (dh == NULL) {
390399
BIO_printf(bio_err, "unable to load DH parameters\n");
@@ -484,10 +493,13 @@ int MAIN(int argc, char **argv)
484493
}
485494

486495
if (!noout) {
487-
if (outformat == FORMAT_ASN1)
488-
i = i2d_DHparams_bio(out, dh);
489-
else if (outformat == FORMAT_PEM) {
490-
if (dh->q)
496+
if (outformat == FORMAT_ASN1) {
497+
if (dh->q != NULL)
498+
i = i2d_DHxparams_bio(out, dh);
499+
else
500+
i = i2d_DHparams_bio(out, dh);
501+
} else if (outformat == FORMAT_PEM) {
502+
if (dh->q != NULL)
491503
i = PEM_write_bio_DHxparams(out, dh);
492504
else
493505
i = PEM_write_bio_DHparams(out, dh);

deps/openssl/openssl/apps/enc.c

+24-9
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,32 @@ int set_hex(char *in, unsigned char *out, int size);
8181
#define BSIZE (8*1024)
8282
#define PROG enc_main
8383

84-
static void show_ciphers(const OBJ_NAME *name, void *bio_)
84+
struct doall_enc_ciphers {
85+
BIO *bio;
86+
int n;
87+
};
88+
89+
static void show_ciphers(const OBJ_NAME *name, void *arg)
8590
{
86-
BIO *bio = bio_;
87-
static int n;
91+
struct doall_enc_ciphers *dec = (struct doall_enc_ciphers *)arg;
92+
const EVP_CIPHER *cipher;
8893

8994
if (!islower((unsigned char)*name->name))
9095
return;
9196

92-
BIO_printf(bio, "-%-25s", name->name);
93-
if (++n == 3) {
94-
BIO_printf(bio, "\n");
95-
n = 0;
97+
/* Filter out ciphers that we cannot use */
98+
cipher = EVP_get_cipherbyname(name->name);
99+
if (cipher == NULL ||
100+
(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0 ||
101+
EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)
102+
return;
103+
104+
BIO_printf(dec->bio, "-%-25s", name->name);
105+
if (++dec->n == 3) {
106+
BIO_printf(dec->bio, "\n");
107+
dec->n = 0;
96108
} else
97-
BIO_printf(bio, " ");
109+
BIO_printf(dec->bio, " ");
98110
}
99111

100112
int MAIN(int, char **);
@@ -130,6 +142,7 @@ int MAIN(int argc, char **argv)
130142
ENGINE *e = NULL;
131143
const EVP_MD *dgst = NULL;
132144
int non_fips_allow = 0;
145+
struct doall_enc_ciphers dec;
133146

134147
apps_startup();
135148

@@ -311,8 +324,10 @@ int MAIN(int argc, char **argv)
311324
#endif
312325

313326
BIO_printf(bio_err, "Cipher Types\n");
327+
dec.n = 0;
328+
dec.bio = bio_err;
314329
OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
315-
show_ciphers, bio_err);
330+
show_ciphers, &dec);
316331
BIO_printf(bio_err, "\n");
317332

318333
goto end;

deps/openssl/openssl/apps/engine.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ static int append_buf(char **buf, const char *s, int *size, int step)
108108
}
109109

110110
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
111+
char *p = *buf;
112+
111113
*size += step;
112114
*buf = OPENSSL_realloc(*buf, *size);
115+
if (*buf == NULL) {
116+
OPENSSL_free(p);
117+
return 0;
118+
}
113119
}
114120

115-
if (*buf == NULL)
116-
return 0;
117-
118121
if (**buf != '\0')
119122
BUF_strlcat(*buf, ", ", *size);
120123
BUF_strlcat(*buf, s, *size);

deps/openssl/openssl/apps/pkeyutl.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ int MAIN(int argc, char **argv)
322322
buf_in, (size_t)buf_inlen);
323323
if (rv == 0)
324324
BIO_puts(out, "Signature Verification Failure\n");
325-
else if (rv == 1)
325+
else if (rv == 1) {
326326
BIO_puts(out, "Signature Verified Successfully\n");
327+
ret = 0;
328+
}
327329
if (rv >= 0)
328330
goto end;
329331
} else {

deps/openssl/openssl/apps/prime.c

+3
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,8 @@ int MAIN(int argc, char **argv)
155155
BIO_printf(bio_err, "options are\n");
156156
BIO_printf(bio_err, "%-14s hex\n", "-hex");
157157
BIO_printf(bio_err, "%-14s number of checks\n", "-checks <n>");
158+
BIO_printf(bio_err, "%-14s generate prime\n", "-generate");
159+
BIO_printf(bio_err, "%-14s number of bits\n", "-bits <n>");
160+
BIO_printf(bio_err, "%-14s safe prime\n", "-safe");
158161
return 1;
159162
}

deps/openssl/openssl/apps/progs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern int srp_main(int argc, char *argv[]);
5858
typedef struct {
5959
int type;
6060
const char *name;
61-
int (*func) (int argc, char *argv[]);
61+
int (*func)(int argc, char *argv[]);
6262
} FUNCTION;
6363
DECLARE_LHASH_OF(FUNCTION);
6464

0 commit comments

Comments
 (0)