Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit cfb6a22

Browse files
committed
Merge commit '3ce7bc40a3c48da1c96c2d04c10045bd797c6aa3' into OpenSSL_1_0_2_WinRT-stable
2 parents e022050 + 3ce7bc4 commit cfb6a22

File tree

171 files changed

+1103
-945
lines changed

Some content is hidden

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

171 files changed

+1103
-945
lines changed

CHANGES

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@
77
https://github.com/openssl/openssl/commits/ and pick the appropriate
88
release branch.
99

10+
Changes between 1.0.2n and 1.0.2o [27 Mar 2018]
11+
12+
*) Constructed ASN.1 types with a recursive definition could exceed the stack
13+
14+
Constructed ASN.1 types with a recursive definition (such as can be found
15+
in PKCS7) could eventually exceed the stack given malicious input with
16+
excessive recursion. This could result in a Denial Of Service attack. There
17+
are no such structures used within SSL/TLS that come from untrusted sources
18+
so this is considered safe.
19+
20+
This issue was reported to OpenSSL on 4th January 2018 by the OSS-fuzz
21+
project.
22+
(CVE-2018-0739)
23+
[Matt Caswell]
24+
1025
Changes between 1.0.2m and 1.0.2n [7 Dec 2017]
1126

1227
*) Read/write after SSL object in error state
@@ -2012,8 +2027,11 @@
20122027
to work with OPENSSL_NO_SSL_INTERN defined.
20132028
[Steve Henson]
20142029

2015-
*) Add SRP support.
2016-
[Tom Wu <[email protected]> and Ben Laurie]
2030+
*) A long standing patch to add support for SRP from EdelWeb (Peter
2031+
Sylvester and Christophe Renou) was integrated.
2032+
[Christophe Renou <[email protected]>, Peter Sylvester
2033+
2034+
Ben Laurie]
20172035

20182036
*) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id.
20192037
[Steve Henson]

Configure

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ my %table=(
354354
"hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
355355

356356
#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
357-
"MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
357+
"MPE/iX-gcc", "gcc:-DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
358358

359359
# DEC Alpha OSF/1/Tru64 targets.
360360
#
@@ -1283,7 +1283,7 @@ my ($prelflags,$postlflags)=split('%',$lflags);
12831283
if (defined($postlflags)) { $lflags=$postlflags; }
12841284
else { $lflags=$prelflags; undef $prelflags; }
12851285

1286-
if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
1286+
if ($target =~ /^mingw/ && `$cross_compile_prefix$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
12871287
{
12881288
$cflags =~ s/\-mno\-cygwin\s*//;
12891289
$shared_ldflag =~ s/\-mno\-cygwin\s*//;
@@ -1675,18 +1675,25 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
16751675
$shlib_minor=$2;
16761676
}
16771677

1678-
my $ecc = $cc;
1679-
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
1678+
my %predefined;
1679+
1680+
# collect compiler pre-defines from gcc or gcc-alike...
1681+
open(PIPE, "$cross_compile_prefix$cc -dM -E -x c /dev/null 2>&1 |");
1682+
while (<PIPE>) {
1683+
m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
1684+
$predefined{$1} = defined($2) ? $2 : "";
1685+
}
1686+
close(PIPE);
16801687

16811688
if ($strict_warnings)
16821689
{
16831690
my $wopt;
1684-
die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
1691+
die "ERROR --strict-warnings requires gcc or clang" unless defined($predefined{__GNUC__});
16851692
foreach $wopt (split /\s+/, $gcc_devteam_warn)
16861693
{
16871694
$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
16881695
}
1689-
if ($ecc eq "clang")
1696+
if (defined($predefined{__clang__}))
16901697
{
16911698
foreach $wopt (split /\s+/, $clang_devteam_warn)
16921699
{
@@ -1737,15 +1744,14 @@ while (<IN>)
17371744
s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
17381745
s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
17391746
s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/;
1740-
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
1747+
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3;
17411748
}
17421749
else {
17431750
s/^CC=.*$/CC= $cc/;
17441751
s/^AR=\s*ar/AR= $ar/;
17451752
s/^RANLIB=.*/RANLIB= $ranlib/;
17461753
s/^RC=.*/RC= $windres/;
1747-
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
1748-
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
1754+
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3;
17491755
}
17501756
s/^CFLAG=.*$/CFLAG= $cflags/;
17511757
s/^DEPFLAG=.*$/DEPFLAG=$depflags/;

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
---------------
1313

1414
/* ====================================================================
15-
* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
15+
* Copyright (c) 1998-2018 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

MacOS/Randomizer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void CRandomizer::AddCurrentMouse (void)
266266

267267
if (labs (mLastMouse.h - mouseLoc.h) > kMouseResolution/2 &&
268268
labs (mLastMouse.v - mouseLoc.v) > kMouseResolution/2)
269-
AddBytes (&mouseLoc, sizeof (mouseLoc),
269+
AddBytes (&mouseLoc, sizeof(mouseLoc),
270270
kMousePositionEntropy);
271271

272272
if (mLastMouse.h == mouseLoc.h && mLastMouse.v == mouseLoc.v)
@@ -286,7 +286,7 @@ void CRandomizer::AddCurrentMouse (void)
286286
(kTypicalMouseIdleTicks/(double)lastCheck);
287287
if (entropy < 0.0)
288288
entropy = 0.0;
289-
AddBytes (&mMouseStill, sizeof (mMouseStill), entropy);
289+
AddBytes (&mMouseStill, sizeof(mMouseStill), entropy);
290290
mMouseStill = 0;
291291
}
292292
mLastMouse = mouseLoc;
@@ -299,7 +299,7 @@ void CRandomizer::AddAbsoluteSystemStartupTime (void)
299299
GetDateTime (&now);
300300
now -= TickCount() / 60; // Time in ticks since machine
301301
// startup
302-
AddBytes (&now, sizeof (now), kSysStartupEntropy);
302+
AddBytes (&now, sizeof(now), kSysStartupEntropy);
303303
}
304304

305305
void CRandomizer::AddTimeSinceMachineStartup (void)
@@ -314,7 +314,7 @@ void CRandomizer::AddAppRunningTime (void)
314314
ProcessSerialNumber PSN;
315315
ProcessInfoRec ProcessInfo;
316316

317-
ProcessInfo.processInfoLength = sizeof (ProcessInfoRec);
317+
ProcessInfo.processInfoLength = sizeof(ProcessInfoRec);
318318
ProcessInfo.processName = nil;
319319
ProcessInfo.processAppSpec = nil;
320320

@@ -324,7 +324,7 @@ void CRandomizer::AddAppRunningTime (void)
324324
// Now add the amount of time in ticks that the current process
325325
// has been active
326326

327-
AddBytes (&ProcessInfo, sizeof (ProcessInfoRec),
327+
AddBytes (&ProcessInfo, sizeof(ProcessInfoRec),
328328
kApplicationUpTimeEntropy);
329329
}
330330

@@ -353,7 +353,7 @@ void CRandomizer::AddStartupVolumeInfo (void)
353353
// unpredictable, so might as well toss the whole block in. See
354354
// comments for entropy estimate justifications.
355355

356-
AddBytes (&pb, sizeof (pb),
356+
AddBytes (&pb, sizeof(pb),
357357
kVolumeBytesEntropy +
358358
log2l (((pb.ioVTotalBytes.hi - pb.ioVFreeBytes.hi)
359359
* 4294967296.0D +
@@ -419,7 +419,7 @@ void CRandomizer::AddBytes (void *data, long size, double entropy)
419419
void CRandomizer::AddNow (double millisecondUncertainty)
420420
{
421421
long time = SysTimer();
422-
AddBytes (&time, sizeof (time), log2l (millisecondUncertainty *
422+
AddBytes (&time, sizeof(time), log2l (millisecondUncertainty *
423423
mTimebaseTicksPerMillisec));
424424
}
425425

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
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.2n and OpenSSL 1.0.2o [27 Mar 2018]
9+
10+
o Constructed ASN.1 types with a recursive definition could exceed the
11+
stack (CVE-2018-0739)
12+
813
Major changes between OpenSSL 1.0.2m and OpenSSL 1.0.2n [7 Dec 2017]
914

1015
o Read/write after SSL object in error state (CVE-2017-3737)

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OpenSSL 1.0.2n 7 Dec 2017
2+
OpenSSL 1.0.2o 27 Mar 2018
33

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

apps/app_rand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
128128
#endif
129129

130130
if (file == NULL)
131-
file = RAND_file_name(buffer, sizeof buffer);
131+
file = RAND_file_name(buffer, sizeof(buffer));
132132
else if (RAND_egd(file) > 0) {
133133
/*
134134
* we try if the given filename is an EGD socket. if it is, we don't
@@ -203,7 +203,7 @@ int app_RAND_write_file(const char *file, BIO *bio_e)
203203
return 0;
204204

205205
if (file == NULL)
206-
file = RAND_file_name(buffer, sizeof buffer);
206+
file = RAND_file_name(buffer, sizeof(buffer));
207207
if (file == NULL || !RAND_write_file(file)) {
208208
BIO_printf(bio_e, "unable to write 'random state'\n");
209209
return 0;

apps/apps.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,9 +1738,9 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
17381738
BUF_strlcpy(buf[0], serialfile, BSIZE);
17391739
else {
17401740
#ifndef OPENSSL_SYS_VMS
1741-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
1741+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
17421742
#else
1743-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
1743+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
17441744
#endif
17451745
}
17461746
#ifdef RL_DEBUG
@@ -1789,14 +1789,14 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
17891789
goto err;
17901790
}
17911791
#ifndef OPENSSL_SYS_VMS
1792-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix);
1792+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
17931793
#else
1794-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, new_suffix);
1794+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
17951795
#endif
17961796
#ifndef OPENSSL_SYS_VMS
1797-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix);
1797+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
17981798
#else
1799-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", serialfile, old_suffix);
1799+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
18001800
#endif
18011801
#ifdef RL_DEBUG
18021802
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
@@ -1877,9 +1877,9 @@ CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
18771877
goto err;
18781878

18791879
#ifndef OPENSSL_SYS_VMS
1880-
BIO_snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
1880+
BIO_snprintf(buf[0], sizeof(buf[0]), "%s.attr", dbfile);
18811881
#else
1882-
BIO_snprintf(buf[0], sizeof buf[0], "%s-attr", dbfile);
1882+
BIO_snprintf(buf[0], sizeof(buf[0]), "%s-attr", dbfile);
18831883
#endif
18841884
dbattr_conf = NCONF_new(NULL);
18851885
if (NCONF_load(dbattr_conf, buf[0], &errorline) <= 0) {
@@ -1967,19 +1967,19 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
19671967
goto err;
19681968
}
19691969
#ifndef OPENSSL_SYS_VMS
1970-
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
1970+
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr", dbfile);
19711971
#else
1972-
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr", dbfile);
1972+
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr", dbfile);
19731973
#endif
19741974
#ifndef OPENSSL_SYS_VMS
1975-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
1975+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.attr.%s", dbfile, suffix);
19761976
#else
1977-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-attr-%s", dbfile, suffix);
1977+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-attr-%s", dbfile, suffix);
19781978
#endif
19791979
#ifndef OPENSSL_SYS_VMS
1980-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
1980+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, suffix);
19811981
#else
1982-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
1982+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, suffix);
19831983
#endif
19841984
#ifdef RL_DEBUG
19851985
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
@@ -2028,29 +2028,29 @@ int rotate_index(const char *dbfile, const char *new_suffix,
20282028
goto err;
20292029
}
20302030
#ifndef OPENSSL_SYS_VMS
2031-
j = BIO_snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
2031+
j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s.attr", dbfile);
20322032
#else
2033-
j = BIO_snprintf(buf[4], sizeof buf[4], "%s-attr", dbfile);
2033+
j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s-attr", dbfile);
20342034
#endif
20352035
#ifndef OPENSSL_SYS_VMS
2036-
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr.%s", dbfile, new_suffix);
2036+
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr.%s", dbfile, new_suffix);
20372037
#else
2038-
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr-%s", dbfile, new_suffix);
2038+
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr-%s", dbfile, new_suffix);
20392039
#endif
20402040
#ifndef OPENSSL_SYS_VMS
2041-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, new_suffix);
2041+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, new_suffix);
20422042
#else
2043-
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, new_suffix);
2043+
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, new_suffix);
20442044
#endif
20452045
#ifndef OPENSSL_SYS_VMS
2046-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", dbfile, old_suffix);
2046+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", dbfile, old_suffix);
20472047
#else
2048-
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", dbfile, old_suffix);
2048+
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", dbfile, old_suffix);
20492049
#endif
20502050
#ifndef OPENSSL_SYS_VMS
2051-
j = BIO_snprintf(buf[3], sizeof buf[3], "%s.attr.%s", dbfile, old_suffix);
2051+
j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s.attr.%s", dbfile, old_suffix);
20522052
#else
2053-
j = BIO_snprintf(buf[3], sizeof buf[3], "%s-attr-%s", dbfile, old_suffix);
2053+
j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s-attr-%s", dbfile, old_suffix);
20542054
#endif
20552055
#ifdef RL_DEBUG
20562056
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", dbfile, buf[1]);
@@ -2604,7 +2604,7 @@ static void jpake_send_step3a(BIO *bconn, JPAKE_CTX *ctx)
26042604

26052605
JPAKE_STEP3A_init(&s3a);
26062606
JPAKE_STEP3A_generate(&s3a, ctx);
2607-
BIO_write(bconn, s3a.hhk, sizeof s3a.hhk);
2607+
BIO_write(bconn, s3a.hhk, sizeof(s3a.hhk));
26082608
(void)BIO_flush(bconn);
26092609
JPAKE_STEP3A_release(&s3a);
26102610
}
@@ -2615,7 +2615,7 @@ static void jpake_send_step3b(BIO *bconn, JPAKE_CTX *ctx)
26152615

26162616
JPAKE_STEP3B_init(&s3b);
26172617
JPAKE_STEP3B_generate(&s3b, ctx);
2618-
BIO_write(bconn, s3b.hk, sizeof s3b.hk);
2618+
BIO_write(bconn, s3b.hk, sizeof(s3b.hk));
26192619
(void)BIO_flush(bconn);
26202620
JPAKE_STEP3B_release(&s3b);
26212621
}
@@ -2625,7 +2625,7 @@ static void readbn(BIGNUM **bn, BIO *bconn)
26252625
char buf[10240];
26262626
int l;
26272627

2628-
l = BIO_gets(bconn, buf, sizeof buf);
2628+
l = BIO_gets(bconn, buf, sizeof(buf));
26292629
assert(l > 0);
26302630
assert(buf[l - 1] == '\n');
26312631
buf[l - 1] = '\0';
@@ -2672,8 +2672,8 @@ static void jpake_receive_step3a(JPAKE_CTX *ctx, BIO *bconn)
26722672
int l;
26732673

26742674
JPAKE_STEP3A_init(&s3a);
2675-
l = BIO_read(bconn, s3a.hhk, sizeof s3a.hhk);
2676-
assert(l == sizeof s3a.hhk);
2675+
l = BIO_read(bconn, s3a.hhk, sizeof(s3a.hhk));
2676+
assert(l == sizeof(s3a.hhk));
26772677
if (!JPAKE_STEP3A_process(ctx, &s3a)) {
26782678
ERR_print_errors(bio_err);
26792679
exit(1);
@@ -2687,8 +2687,8 @@ static void jpake_receive_step3b(JPAKE_CTX *ctx, BIO *bconn)
26872687
int l;
26882688

26892689
JPAKE_STEP3B_init(&s3b);
2690-
l = BIO_read(bconn, s3b.hk, sizeof s3b.hk);
2691-
assert(l == sizeof s3b.hk);
2690+
l = BIO_read(bconn, s3b.hk, sizeof(s3b.hk));
2691+
assert(l == sizeof(s3b.hk));
26922692
if (!JPAKE_STEP3B_process(ctx, &s3b)) {
26932693
ERR_print_errors(bio_err);
26942694
exit(1);

0 commit comments

Comments
 (0)