Commit graph

12264 commits

Author SHA1 Message Date
Matt Caswell
f26a179abc Update CHANGES and NEWS for release
Add details about the latest issues into CHANGES and NEWS ready for the
next release.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-28 13:49:56 +00:00
Matt Caswell
75374adf8a Add a test for small subgroup attacks on DH/DHE
Following on from the previous commit, add a test to ensure that
DH_compute_key correctly fails if passed a bad y such that:

y^q (mod p) != 1

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-28 13:49:56 +00:00
Matt Caswell
c5b831f21d Always generate DH keys for ephemeral DH cipher suites
Modified version of the commit ffaef3f15 in the master branch by Stephen
Henson. This makes the SSL_OP_SINGLE_DH_USE option a no-op and always
generates a new DH key for every handshake regardless.

CVE-2016-0701 (fix part 2 or 2)

Issue reported by Antonio Sanso

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-28 13:49:56 +00:00
Matt Caswell
878e2c5b13 Prevent small subgroup attacks on DH/DHE
Historically OpenSSL only ever generated DH parameters based on "safe"
primes. More recently (in version 1.0.2) support was provided for
generating X9.42 style parameter files such as those required for RFC
5114 support. The primes used in such files may not be "safe". Where an
application is using DH configured with parameters based on primes that
are not "safe" then an attacker could use this fact to find a peer's
private DH exponent. This attack requires that the attacker complete
multiple handshakes in which the peer uses the same DH exponent.

A simple mitigation is to ensure that y^q (mod p) == 1

CVE-2016-0701 (fix part 1 of 2)

Issue reported by Antonio Sanso.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-28 13:49:56 +00:00
Viktor Dukhovni
d81a160058 Better SSLv2 cipher-suite enforcement
Based on patch by: Nimrod Aviram <nimrod.aviram@gmail.com>

CVE-2015-3197

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-28 13:48:24 +00:00
Mouse
3665fa2543 pkeyutl: allow peerkey for EC_DERIVE to reside on a hardware token (public key for now)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-22 20:13:31 +01:00
Billy Brumley
2b80d00e3a RT3863 ECC: Add missing NULL check. Set a flag
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit dd67493c34)
2016-01-21 14:14:33 +00:00
Rich Salz
78a140ecb3 GH issue 572: Error in help message
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20 18:52:18 -05:00
Matt Caswell
f73c737c7a Handle SSL_shutdown while in init more appropriately
Calling SSL_shutdown while in init previously gave a "1" response, meaning
everything was successfully closed down (even though it wasn't). Better is
to send our close_notify, but fail when trying to receive one.

The problem with doing a shutdown while in the middle of a handshake is
that once our close_notify is sent we shouldn't really do anything else
(including process handshake/CCS messages) until we've received a
close_notify back from the peer. However the peer might send a CCS before
acting on our close_notify - so we won't be able to read it because we're
not acting on CCS messages!

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20 13:55:36 +00:00
Richard Levitte
930d87c1e1 Fix BSD -rpath parameter
For BSD systems, Configure adds a shared_ldflags including a reference
to the Makefile variable LIBRPATH, but since it must be passed down to
Makefile.shared, care must be taken so the value of LIBRPATH doesn't
get expanded too early, or it ends up giving an empty string.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(cherry picked from commit c64879d3f3)
2016-01-19 20:59:26 +01:00
Alessandro Ghedini
607e77300e Validate ClientHello session_id field length and send alert on failure
RT#4080

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19 15:37:16 +00:00
Prayag Verma
0555901cb4 Update license year range to 2016
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 02f7037247)
2016-01-19 10:24:35 -05:00
Kristian Amlie
7934ce27cd Don't use "grep -q", "-q" is not POSIX, and fails on Solaris.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-18 16:20:51 +01:00
Viktor Dukhovni
4d6fe78f65 Empty SNI names are not valid
While empty inputs to SSL_set1_host() clear the reference identifier
list.

(cherry-picked from 1.1.0-dev)

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-17 16:58:48 -05:00
Zi Lin
15debc128a NGX-2040 - fix wildcard match on punycode/IDNA DNS names
- bugfix: should not treat '--' as invalid domain substring.
    - '-' should not be the first letter of a domain

Signed-off-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-15 14:48:17 -05:00
Dr. Stephen Henson
e254d12c43 To avoid possible time_t overflow use X509_time_adj_ex()
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
(cherry picked from commit 9aa00b187a)

Conflicts:
	apps/x509.c
2016-01-14 03:02:27 +00:00
Mouse
8788fb97a8 Root cause discovered and fixed, this fix became unnecessary
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
Uri Blumenthal
6fa6a66285 Changed help output
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
Mouse
a2a29f702a Pass engine=NULL to EVP_PKEY_CTX_new(), unless "-engine_impl" was given
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
Mouse
8259ccb44d Remove unnecessary debugging fprintf
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
Mouse
ad81ca9061 Fixed crash (SIGSEGV) when freeing of ex_data stumbles upon a NULL-pointer.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
Mouse
d65a8d0b7e Fixed a bug preventing pkeyutl from accessing keys directly on the token via engine_pkcs11
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-13 01:23:34 +01:00
arijitnayak
75fdee0482 Wrong definition of the macro SSL_set1_sigalgs in ssl.h
Error in the definition of the macro SSL_set1_sigalgs(ctx, slist,
slistlen): the third parameter 'slistlen' not used in the substitution
code; used 'clistlen' instead. As a result of this, compilation error
occurs when any application uses this macro.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-12 12:53:27 -05:00
Kurt Roeckx
a4530ce039 Change minimum DH size from 768 to 1024
Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
2016-01-11 00:01:52 +01:00
Kurt Roeckx
cb19c0d15f File is about s_time, not s_client
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit 1918e01c9f)
2016-01-10 13:14:19 +01:00
Viktor Dukhovni
a3d74afcae Fix X509_STORE_CTX_cleanup()
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-02 11:14:05 -05:00
Rich Salz
4d9c6fa01b RT4202: Update rt URL's.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 41977c53cd)
2015-12-28 16:41:10 -05:00
Matt Caswell
c52c3b5e11 Add some documentation for the OCSP callback functions
Describe the usage of the OCSP callback functions on both the client and
the server side.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-27 22:02:33 +00:00
Matt Caswell
0ac6239955 Ensure we don't call the OCSP callback if resuming a session
It makes no sense to call the OCSP status callback if we are resuming a
session because no certificates will be sent.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-27 22:02:33 +00:00
Matt Caswell
905943af3b Fix error when server does not send CertificateStatus message
If a server sends the status_request extension then it may choose
to send the CertificateStatus message. However this is optional.
We were treating it as mandatory and the connection was failing.

Thanks to BoringSSL for reporting this issue.

RT#4120

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-27 22:02:33 +00:00
Daniel Kahn Gillmor
155a1623d0 The functions take a SSL *, not a SSL_CTX *
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>

RT: #4192, MR: #1533
(cherry picked from commit d938e8dfee)
2015-12-23 22:33:26 +01:00
David Benjamin
1c7de36f62 Fix memory leak in DSA redo case.
Found by clang scan-build.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>

RT: #4184, MR: #1496
(cherry picked from commit 679d87515d)
2015-12-22 11:49:57 +01:00
Dr. Stephen Henson
6656ba7152 Don't check RSA_FLAG_SIGN_VER.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-20 19:27:03 +00:00
Richard Levitte
17592f323a BIO_s_datagram() ctrl doesn't support SEEK/TELL, so don't pretend it does
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-19 22:07:42 +01:00
Richard Levitte
6d97060ee0 Correct or add comments indicating what controls belong to what
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-19 22:07:42 +01:00
Richard Levitte
7eb5125125 Document how BIO_get_conn_ip and BIO_get_conn_int_port actually work
No dummy arguments.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-19 22:07:42 +01:00
Richard Levitte
2a60fccdd9 Have BIO_get_conn_int_port use BIO_ctrl instead BIO_int_ctrl
BIO_int_ctrl isn't made for the purpose BIO_get_conn_int_port used it
for.

This also changes BIO_C_GET_CONNECT to actually return the port
instead of assigning it to a pointer that was never returned back to
the caller.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-19 22:07:42 +01:00
Matt Caswell
f6cadeeeed Fix more URLs mangled by reformat
Fix some more URLs mangled by indent in the reformat. These ones don't exist
in master so we have a separate commit. Based on a patch supplied by Arnaud
Lacombe <al@aerilon.ca>

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-19 14:44:03 +00:00
Matt Caswell
dd045d17e7 Fix URLs mangled by reformat
Some URLs in the source code ended up getting mangled by indent. This fixes
it. Based on a patch supplied by Arnaud Lacombe <al@aerilon.ca>

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-19 14:43:43 +00:00
Richard Levitte
93a17f79b9 Remove the "eay" c-file-style indicators
Since we don't use the eay style any more, there's no point tryint to
tell emacs to use it.

Reviewed-by: Ben Laurie <ben@openssl.org>
2015-12-18 13:39:34 +01:00
Rich Salz
ecadde4d4d Provide better "make depend" warning.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 2e31ef0366)
2015-12-16 17:46:07 -05:00
Emilia Kasper
44e4f5b04b Fix a ** 0 mod 1 = 0 for real this time.
Commit 2b0180c37f attempted to do this but
only hit one of many BN_mod_exp codepaths. Fix remaining variants and add
a test for each method.

Thanks to Hanno Boeck for reporting this issue.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
(cherry picked from commit d911097d7c)
2015-12-14 17:57:49 +01:00
Richard Levitte
474a53b3a3 Fix tarball production to keep test/bctest and util/pod2mantest
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-14 03:54:56 +01:00
Andy Polyakov
e780ed0336 x86_64 assembly pack: tune clang version detection even further.
RT#4171

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit b974943234)
2015-12-13 22:19:32 +01:00
Andy Polyakov
3cd33c42e3 ec/ecp_nistz256_table.c: fix potential misalignment problem with Sun C.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-10 20:13:28 +01:00
Matt Caswell
50053969e3 Ensure |rwstate| is set correctly on BIO_flush
A BIO_flush call in the DTLS code was not correctly setting the |rwstate|
variable to SSL_WRITING. This means that SSL_get_error() will not return
SSL_ERROR_WANT_WRITE in the event of an IO retry.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 67f60be8c9)
2015-12-10 12:47:49 +00:00
Matt Caswell
01b5c1239b Fix DTLS handshake fragment retries
If using DTLS and NBIO then if a second or subsequent handshake message
fragment hits a retry, then the retry attempt uses the wrong fragment
offset value. This commit restores the fragment offset from the last
attempt.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 2ad226e88b)
2015-12-10 12:47:49 +00:00
Matt Caswell
f4d1926f95 Add a return value check
If the call to OBJ_find_sigid_by_algs fails to find the relevant NID then
we should set the NID to NID_undef.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 330dcb09b2)
2015-12-10 11:50:45 +00:00
Dr Stephen Henson
9501418ea2 Don't use applink for static builds.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-09 00:30:29 +00:00
Rich Salz
50b255a260 Refer to website for acknowledgements.
Reviewed-by: Steve Marquess <marquess@openssl.com>
(cherry picked from commit ab29c82a55)
2015-12-08 16:07:59 -05:00