Skip to content

Commit 4096816

Browse files
committed
NetBSD src for "user", checkout.sh rev 46240e7617dd560b1dc4da243418ffed9680f7b7
1 parent 8002554 commit 4096816

Some content is hidden

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

53 files changed

+1168
-532
lines changed

crypto/external/bsd/openssl/dist/CHANGES

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

5+
Changes between 1.0.1r and 1.0.1s [1 Mar 2016]
6+
7+
* Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.
8+
Builds that are not configured with "enable-weak-ssl-ciphers" will not
9+
provide any "EXPORT" or "LOW" strength ciphers.
10+
[Viktor Dukhovni]
11+
12+
* Disable SSLv2 default build, default negotiation and weak ciphers. SSLv2
13+
is by default disabled at build-time. Builds that are not configured with
14+
"enable-ssl2" will not support SSLv2. Even if "enable-ssl2" is used,
15+
users who want to negotiate SSLv2 via the version-flexible SSLv23_method()
16+
will need to explicitly call either of:
17+
18+
SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2);
19+
or
20+
SSL_clear_options(ssl, SSL_OP_NO_SSLv2);
21+
22+
as appropriate. Even if either of those is used, or the application
23+
explicitly uses the version-specific SSLv2_method() or its client and
24+
server variants, SSLv2 ciphers vulnerable to exhaustive search key
25+
recovery have been removed. Specifically, the SSLv2 40-bit EXPORT
26+
ciphers, and SSLv2 56-bit DES are no longer available.
27+
(CVE-2016-0800)
28+
[Viktor Dukhovni]
29+
30+
*) Fix a double-free in DSA code
31+
32+
A double free bug was discovered when OpenSSL parses malformed DSA private
33+
keys and could lead to a DoS attack or memory corruption for applications
34+
that receive DSA private keys from untrusted sources. This scenario is
35+
considered rare.
36+
37+
This issue was reported to OpenSSL by Adam Langley(Google/BoringSSL) using
38+
libFuzzer.
39+
(CVE-2016-0705)
40+
[Stephen Henson]
41+
42+
*) Disable SRP fake user seed to address a server memory leak.
43+
44+
Add a new method SRP_VBASE_get1_by_user that handles the seed properly.
45+
46+
SRP_VBASE_get_by_user had inconsistent memory management behaviour.
47+
In order to fix an unavoidable memory leak, SRP_VBASE_get_by_user
48+
was changed to ignore the "fake user" SRP seed, even if the seed
49+
is configured.
50+
51+
Users should use SRP_VBASE_get1_by_user instead. Note that in
52+
SRP_VBASE_get1_by_user, caller must free the returned value. Note
53+
also that even though configuring the SRP seed attempts to hide
54+
invalid usernames by continuing the handshake with fake
55+
credentials, this behaviour is not constant time and no strong
56+
guarantees are made that the handshake is indistinguishable from
57+
that of a valid user.
58+
(CVE-2016-0798)
59+
[Emilia Käsper]
60+
61+
*) Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption
62+
63+
In the BN_hex2bn function the number of hex digits is calculated using an
64+
int value |i|. Later |bn_expand| is called with a value of |i * 4|. For
65+
large values of |i| this can result in |bn_expand| not allocating any
66+
memory because |i * 4| is negative. This can leave the internal BIGNUM data
67+
field as NULL leading to a subsequent NULL ptr deref. For very large values
68+
of |i|, the calculation |i * 4| could be a positive value smaller than |i|.
69+
In this case memory is allocated to the internal BIGNUM data field, but it
70+
is insufficiently sized leading to heap corruption. A similar issue exists
71+
in BN_dec2bn. This could have security consequences if BN_hex2bn/BN_dec2bn
72+
is ever called by user applications with very large untrusted hex/dec data.
73+
This is anticipated to be a rare occurrence.
74+
75+
All OpenSSL internal usage of these functions use data that is not expected
76+
to be untrusted, e.g. config file data or application command line
77+
arguments. If user developed applications generate config file data based
78+
on untrusted data then it is possible that this could also lead to security
79+
consequences. This is also anticipated to be rare.
80+
81+
This issue was reported to OpenSSL by Guido Vranken.
82+
(CVE-2016-0797)
83+
[Matt Caswell]
84+
85+
*) Fix memory issues in BIO_*printf functions
86+
87+
The internal |fmtstr| function used in processing a "%s" format string in
88+
the BIO_*printf functions could overflow while calculating the length of a
89+
string and cause an OOB read when printing very long strings.
90+
91+
Additionally the internal |doapr_outch| function can attempt to write to an
92+
OOB memory location (at an offset from the NULL pointer) in the event of a
93+
memory allocation failure. In 1.0.2 and below this could be caused where
94+
the size of a buffer to be allocated is greater than INT_MAX. E.g. this
95+
could be in processing a very long "%s" format string. Memory leaks can
96+
also occur.
97+
98+
The first issue may mask the second issue dependent on compiler behaviour.
99+
These problems could enable attacks where large amounts of untrusted data
100+
is passed to the BIO_*printf functions. If applications use these functions
101+
in this way then they could be vulnerable. OpenSSL itself uses these
102+
functions when printing out human-readable dumps of ASN.1 data. Therefore
103+
applications that print this data could be vulnerable if the data is from
104+
untrusted sources. OpenSSL command line applications could also be
105+
vulnerable where they print out ASN.1 data, or if untrusted data is passed
106+
as command line arguments.
107+
108+
Libssl is not considered directly vulnerable. Additionally certificates etc
109+
received via remote connections via libssl are also unlikely to be able to
110+
trigger these issues because of message size limits enforced within libssl.
111+
112+
This issue was reported to OpenSSL Guido Vranken.
113+
(CVE-2016-0799)
114+
[Matt Caswell]
115+
116+
*) Side channel attack on modular exponentiation
117+
118+
A side-channel attack was found which makes use of cache-bank conflicts on
119+
the Intel Sandy-Bridge microarchitecture which could lead to the recovery
120+
of RSA keys. The ability to exploit this issue is limited as it relies on
121+
an attacker who has control of code in a thread running on the same
122+
hyper-threaded core as the victim thread which is performing decryptions.
123+
124+
This issue was reported to OpenSSL by Yuval Yarom, The University of
125+
Adelaide and NICTA, Daniel Genkin, Technion and Tel Aviv University, and
126+
Nadia Heninger, University of Pennsylvania with more information at
127+
http://cachebleed.info.
128+
(CVE-2016-0702)
129+
[Andy Polyakov]
130+
131+
*) Change the req app to generate a 2048-bit RSA/DSA key by default,
132+
if no keysize is specified with default_bits. This fixes an
133+
omission in an earlier change that changed all RSA/DSA key generation
134+
apps to use 2048 bits by default.
135+
[Emilia Käsper]
136+
5137
Changes between 1.0.1q and 1.0.1r [28 Jan 2016]
6138

7139
*) Protection for DH small subgroup attacks
@@ -62,7 +194,7 @@
62194
[Emilia Käsper]
63195

64196
*) In DSA_generate_parameters_ex, if the provided seed is too short,
65-
return an error
197+
use a random seed, as already documented.
66198
[Rich Salz and Ismo Puustinen <[email protected]>]
67199

68200
Changes between 1.0.1o and 1.0.1p [9 Jul 2015]

crypto/external/bsd/openssl/dist/Configure

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
5858
# library and will be loaded in run-time by the OpenSSL library.
5959
# sctp include SCTP support
6060
# 386 generate 80386 code
61+
# enable-weak-ssl-ciphers
62+
# Enable EXPORT and LOW SSLv3 ciphers that are disabled by
63+
# default. Note, weak SSLv2 ciphers are unconditionally
64+
# disabled.
6165
# no-sse2 disables IA-32 SSE2 code, above option implies no-sse2
6266
# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
6367
# -<xxx> +<xxx> compiler options are passed through
@@ -724,10 +728,12 @@ my %disabled = ( # "what" => "comment" [or special keyword "experimental
724728
"md2" => "default",
725729
"rc5" => "default",
726730
"rfc3779" => "default",
727-
"sctp" => "default",
731+
"sctp" => "default",
728732
"shared" => "default",
733+
"ssl2" => "default",
729734
"store" => "experimental",
730735
"unit-test" => "default",
736+
"weak-ssl-ciphers" => "default",
731737
"zlib" => "default",
732738
"zlib-dynamic" => "default"
733739
);

crypto/external/bsd/openssl/dist/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.1s
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=

crypto/external/bsd/openssl/dist/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.1r and OpenSSL 1.0.1s [1 Mar 2016]
9+
10+
o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.
11+
o Disable SSLv2 default build, default negotiation and weak ciphers
12+
(CVE-2016-0800)
13+
o Fix a double-free in DSA code (CVE-2016-0705)
14+
o Disable SRP fake user seed to address a server memory leak
15+
(CVE-2016-0798)
16+
o Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption
17+
(CVE-2016-0797)
18+
o Fix memory issues in BIO_*printf functions (CVE-2016-0799)
19+
o Fix side channel attack on modular exponentiation (CVE-2016-0702)
20+
821
Major changes between OpenSSL 1.0.1q and OpenSSL 1.0.1r [28 Jan 2016]
922

1023
o Protection for DH small subgroup attacks

crypto/external/bsd/openssl/dist/README

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

2-
OpenSSL 1.0.1r 28 Jan 2016
2+
OpenSSL 1.0.1s 1 Mar 2016
33

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

crypto/external/bsd/openssl/dist/apps/s_server.c

+25-14
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ typedef struct srpsrvparm_st {
416416
static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
417417
{
418418
srpsrvparm *p = (srpsrvparm *) arg;
419+
int ret = SSL3_AL_FATAL;
420+
419421
if (p->login == NULL && p->user == NULL) {
420422
p->login = SSL_get_srp_username(s);
421423
BIO_printf(bio_err, "SRP username = \"%s\"\n", p->login);
@@ -424,21 +426,25 @@ static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
424426

425427
if (p->user == NULL) {
426428
BIO_printf(bio_err, "User %s doesn't exist\n", p->login);
427-
return SSL3_AL_FATAL;
429+
goto err;
428430
}
431+
429432
if (SSL_set_srp_server_param
430433
(s, p->user->N, p->user->g, p->user->s, p->user->v,
431434
p->user->info) < 0) {
432435
*ad = SSL_AD_INTERNAL_ERROR;
433-
return SSL3_AL_FATAL;
436+
goto err;
434437
}
435438
BIO_printf(bio_err,
436439
"SRP parameters set: username = \"%s\" info=\"%s\" \n",
437440
p->login, p->user->info);
438-
/* need to check whether there are memory leaks */
441+
ret = SSL_ERROR_NONE;
442+
443+
err:
444+
SRP_user_pwd_free(p->user);
439445
p->user = NULL;
440446
p->login = NULL;
441-
return SSL_ERROR_NONE;
447+
return ret;
442448
}
443449

444450
#endif
@@ -2249,9 +2255,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
22492255
#ifndef OPENSSL_NO_SRP
22502256
while (SSL_get_error(con, k) == SSL_ERROR_WANT_X509_LOOKUP) {
22512257
BIO_printf(bio_s_out, "LOOKUP renego during write\n");
2258+
SRP_user_pwd_free(srp_callback_parm.user);
22522259
srp_callback_parm.user =
2253-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2254-
srp_callback_parm.login);
2260+
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
2261+
srp_callback_parm.login);
22552262
if (srp_callback_parm.user)
22562263
BIO_printf(bio_s_out, "LOOKUP done %s\n",
22572264
srp_callback_parm.user->info);
@@ -2305,9 +2312,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
23052312
#ifndef OPENSSL_NO_SRP
23062313
while (SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) {
23072314
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
2315+
SRP_user_pwd_free(srp_callback_parm.user);
23082316
srp_callback_parm.user =
2309-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2310-
srp_callback_parm.login);
2317+
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
2318+
srp_callback_parm.login);
23112319
if (srp_callback_parm.user)
23122320
BIO_printf(bio_s_out, "LOOKUP done %s\n",
23132321
srp_callback_parm.user->info);
@@ -2392,9 +2400,10 @@ static int init_ssl_connection(SSL *con)
23922400
while (i <= 0 && SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) {
23932401
BIO_printf(bio_s_out, "LOOKUP during accept %s\n",
23942402
srp_callback_parm.login);
2403+
SRP_user_pwd_free(srp_callback_parm.user);
23952404
srp_callback_parm.user =
2396-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2397-
srp_callback_parm.login);
2405+
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
2406+
srp_callback_parm.login);
23982407
if (srp_callback_parm.user)
23992408
BIO_printf(bio_s_out, "LOOKUP done %s\n",
24002409
srp_callback_parm.user->info);
@@ -2621,9 +2630,10 @@ static int www_body(char *hostname, int s, unsigned char *context)
26212630
&& SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) {
26222631
BIO_printf(bio_s_out, "LOOKUP during accept %s\n",
26232632
srp_callback_parm.login);
2633+
SRP_user_pwd_free(srp_callback_parm.user);
26242634
srp_callback_parm.user =
2625-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2626-
srp_callback_parm.login);
2635+
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
2636+
srp_callback_parm.login);
26272637
if (srp_callback_parm.user)
26282638
BIO_printf(bio_s_out, "LOOKUP done %s\n",
26292639
srp_callback_parm.user->info);
@@ -2663,9 +2673,10 @@ static int www_body(char *hostname, int s, unsigned char *context)
26632673
if (BIO_should_io_special(io)
26642674
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
26652675
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
2676+
SRP_user_pwd_free(srp_callback_parm.user);
26662677
srp_callback_parm.user =
2667-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2668-
srp_callback_parm.login);
2678+
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
2679+
srp_callback_parm.login);
26692680
if (srp_callback_parm.user)
26702681
BIO_printf(bio_s_out, "LOOKUP done %s\n",
26712682
srp_callback_parm.user->info);

0 commit comments

Comments
 (0)