10171 Commits

Author SHA1 Message Date
Tim Hudson
f326f6544d mark all block comments that need format preserving so that
indent will not alter them when reformatting comments

(cherry picked from commit 1d97c8435171a7af575f73c526d79e1ef0ee5960)

Conflicts:
	crypto/bn/bn_lcl.h
	crypto/bn/bn_prime.c
	crypto/engine/eng_all.c
	crypto/rc4/rc4_utl.c
	crypto/sha/sha.h
	ssl/kssl.c
	ssl/t1_lib.c

Conflicts:
	crypto/rc4/rc4_enc.c
	crypto/x509v3/v3_scts.c
	crypto/x509v3/v3nametest.c
	ssl/d1_both.c
	ssl/s3_srvr.c
	ssl/ssl.h
	ssl/ssl_locl.h
	ssl/ssltest.c
	ssl/t1_lib.c

Conflicts:
	crypto/asn1/a_sign.c
	crypto/bn/bn_div.c
	crypto/dsa/dsa_asn1.c
	crypto/ec/ecp_nistp224.c
	crypto/ec/ecp_nistp256.c
	crypto/ec/ecp_nistp521.c
	crypto/ec/ecp_nistputil.c
	crypto/modes/gcm128.c
	crypto/opensslv.h
	ssl/d1_both.c
	ssl/heartbeat_test.c
	ssl/s3_clnt.c
	ssl/s3_srvr.c
	ssl/ssl_sess.c
	ssl/t1_lib.c
	test/testutil.h

Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22 09:41:18 +00:00
Matt Caswell
569c68744a Prepare for 1.0.0r-dev
Reviewed-by: Stephen Henson <steve@openssl.org>
OpenSSL_1_0_0-pre-reformat
2015-01-15 15:01:09 +00:00
Matt Caswell
cdac2e8928 Prepare for 1.0.0q release
Reviewed-by: Stephen Henson <steve@openssl.org>
OpenSSL_1_0_0q
2015-01-15 14:56:27 +00:00
Matt Caswell
01fb34ad43 make update
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-15 14:56:27 +00:00
Matt Caswell
08fac3fb6f Updates to CHANGES and NEWS
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2015-01-15 13:18:57 +00:00
Richard Levitte
0c8dc6ebe5 Fixup installation script for VMS
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-14 19:17:17 +01:00
Richard Levitte
f4f1e80801 VMS fixups for 1.0.0
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-14 00:18:23 +01:00
Matt Caswell
36f309c50a Make output from openssl version -f consistent with previous versions
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 2d2671790ee12dedd92c97f35b6feb755b8d4374)
2015-01-13 11:29:21 +00:00
Matt Caswell
94e5cf36bd Fix warning where BIO_FLAGS_UPLINK was being redefined.
This warning breaks the build in 1.0.0 and 0.9.8

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit b1ffc6ca1c387efad0772c16dfe426afef45dc4f)
2015-01-13 11:25:55 +00:00
Matt Caswell
23df532ec4 Avoid deprecation problems in Visual Studio 13
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 86d21d0b9577322ac5da0114c5fac16eb49b4cef)
2015-01-13 09:48:38 +00:00
Matt Caswell
b960060a0d Further windows specific .gitignore entries
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 41c9cfbc4ee7345547fb98cccb8511f082f0910b)
2015-01-09 23:41:07 +00:00
Matt Caswell
e9cb6eb1d3 Update .gitignore with windows files to be excluded from git
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	.gitignore

(cherry picked from commit 04f670cf3d8f22e0d197a071d2db536fb7ebd9c7)
2015-01-09 11:30:50 +00:00
Matt Caswell
181ae2badb Fix build failure on Windows due to undefined cflags identifier
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 5c5e7e1a7eb114cf136e1ae4b6a413bc48ba41eb)
2015-01-08 19:28:43 +00:00
Matt Caswell
a98051fb47 Prepare for 1.0.0q-dev
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-08 14:23:38 +00:00
Matt Caswell
225628f280 Prepare for 1.0.0p release
Reviewed-by: Stephen Henson <steve@openssl.org>
OpenSSL_1_0_0p
2015-01-08 14:21:42 +00:00
Matt Caswell
ca39b261bf make update
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-01-08 14:21:42 +00:00
Matt Caswell
c1beec0e6d CHANGES and NEWS updates for release
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Steve Henson <steve@openssl.org>
2015-01-08 14:14:56 +00:00
Matt Caswell
b095884a58 A memory leak can occur in dtls1_buffer_record if either of the calls to
ssl3_setup_buffers or pqueue_insert fail. The former will fail if there is a
malloc failure, whilst the latter will fail if attempting to add a duplicate
record to the queue. This should never happen because duplicate records should
be detected and dropped before any attempt to add them to the queue.
Unfortunately records that arrive that are for the next epoch are not being
recorded correctly, and therefore replays are not being detected.
Additionally, these "should not happen" failures that can occur in
dtls1_buffer_record are not being treated as fatal and therefore an attacker
could exploit this by sending repeated replay records for the next epoch,
eventually causing a DoS through memory exhaustion.

Thanks to Chris Mueller for reporting this issue and providing initial
analysis and a patch. Further analysis and the final patch was performed by
Matt Caswell from the OpenSSL development team.

CVE-2015-0206

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit 652ff0f4796eecd8729b4690f2076d1c7ccb2862)
2015-01-08 14:14:56 +00:00
Dr. Stephen Henson
f7fe3d235a Unauthenticated DH client certificate fix.
Fix to prevent use of DH client certificates without sending
certificate verify message.

If we've used a client certificate to generate the premaster secret
ssl3_get_client_key_exchange returns 2 and ssl3_get_cert_verify is
never called.

We can only skip the certificate verify message in
ssl3_get_cert_verify if the client didn't send a certificate.

Thanks to Karthikeyan Bhargavan for reporting this issue.
CVE-2015-0205
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-08 14:14:56 +00:00
Matt Caswell
b2688c9161 Follow on from CVE-2014-3571. This fixes the code that was the original source
of the crash due to p being NULL. Steve's fix prevents this situation from
occuring - however this is by no means obvious by looking at the code for
dtls1_get_record. This fix just makes things look a bit more sane.

Conflicts:
	ssl/d1_pkt.c

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
2015-01-08 14:14:29 +00:00
Dr. Stephen Henson
bf6fa208b5 Fix crash in dtls1_get_record whilst in the listen state where you get two
separate reads performed - one for the header and one for the body of the
handshake record.

CVE-2014-3571

Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-08 11:25:45 +00:00
Andy Polyakov
eb37b6aa41 Fix for CVE-2014-3570.
Reviewed-by: Emilia Kasper <emilia@openssl.org>
2015-01-08 11:25:45 +00:00
Dr. Stephen Henson
f66f76a24a fix error discrepancy
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 4a4d4158572fd8b3dc641851b8378e791df7972d)
2015-01-07 18:11:07 +00:00
Dr. Stephen Henson
65c63da207 use correct credit in CHANGES
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 4138e3882556c762d77eb827b8be98507cde48df)
2015-01-06 22:41:45 +00:00
Dr. Stephen Henson
9f028e4a78 use correct function name
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit cb62ab4b17818fe66d2fed0a7fe71969131c811b)
2015-01-06 21:05:07 +00:00
Matt Caswell
64eec8f898 Remove blank line from start of cflags character array in buildinf.h
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit b691154e18c0367643696db3cf73debe9ddfa9ae)
2015-01-06 15:39:32 +00:00
Dr. Stephen Henson
08a88774bd Only allow ephemeral RSA keys in export ciphersuites.
OpenSSL clients would tolerate temporary RSA keys in non-export
ciphersuites. It also had an option SSL_OP_EPHEMERAL_RSA which
enabled this server side. Remove both options as they are a
protocol violation.

Thanks to Karthikeyan Bhargavan for reporting this issue.
(CVE-2015-0204)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>

(cherry picked from commit 4b4c1fcc88aec8c9e001b0a0077d3cd4de1ed0e6)

Conflicts:
	CHANGES
	doc/ssl/SSL_CTX_set_options.pod
2015-01-06 13:18:46 +00:00
Dr. Stephen Henson
802a070bb6 ECDH downgrade bug fix.
Fix bug where an OpenSSL client would accept a handshake using an
ephemeral ECDH ciphersuites with the server key exchange message omitted.

Thanks to Karthikeyan Bhargavan for reporting this issue.

CVE-2014-3572
Reviewed-by: Matt Caswell <matt@openssl.org>

(cherry picked from commit b15f8769644b00ef7283521593360b7b2135cb63)

Conflicts:
	CHANGES
2015-01-05 23:52:28 +00:00
Dr. Stephen Henson
31c65a7bc0 update ordinals
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-01-05 16:50:31 +00:00
Dr. Stephen Henson
208a6012be Fix various certificate fingerprint issues.
By using non-DER or invalid encodings outside the signed portion of a
certificate the fingerprint can be changed without breaking the signature.
Although no details of the signed portion of the certificate can be changed
this can cause problems with some applications: e.g. those using the
certificate fingerprint for blacklists.

1. Reject signatures with non zero unused bits.

If the BIT STRING containing the signature has non zero unused bits reject
the signature. All current signature algorithms require zero unused bits.

2. Check certificate algorithm consistency.

Check the AlgorithmIdentifier inside TBS matches the one in the
certificate signature. NB: this will result in signature failure
errors for some broken certificates.

3. Check DSA/ECDSA signatures use DER.

Reencode DSA/ECDSA signatures and compare with the original received
signature. Return an error if there is a mismatch.

This will reject various cases including garbage after signature
(thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS
program for discovering this case) and use of BER or invalid ASN.1 INTEGERs
(negative or with leading zeroes).

CVE-2014-8275
Reviewed-by: Emilia Käsper <emilia@openssl.org>

(cherry picked from commit 684400ce192dac51df3d3e92b61830a6ef90be3e)

Conflicts:
	CHANGES
	crypto/dsa/dsa_asn1.c
2015-01-05 15:06:15 +00:00
Dr. Stephen Henson
d7f8a7cafd Constify ASN1_TYPE_cmp add X509_ALGOR_cmp.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 4c52816d35681c0533c25fdd3abb4b7c6962302d)

Conflicts:
	crypto/asn1/x_algor.c
	crypto/x509/x509.h
2015-01-05 14:57:39 +00:00
Dr. Stephen Henson
0f1c30b00d Reject invalid constructed encodings.
According to X6.90 null, object identifier, boolean, integer and enumerated
types can only have primitive encodings: return an error if any of
these are received with a constructed encoding.
Reviewed-by: Emilia Käsper <emilia@openssl.org>

(cherry picked from commit f5e4b6b5b566320a8d774f9475540f7d0e6a704d)

Conflicts:
	crypto/asn1/asn1_err.c
2015-01-05 14:39:07 +00:00
Matt Caswell
c4b969639a Fix a problem if CFLAGS is too long cversion.c fails to compile when config
is run with --strict-warnings.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 488f16e31b8f5ec2513410929325d0830d76762d)
2014-12-19 14:11:20 +00:00
Kurt Roeckx
bfb2e4b280 Return error when a bit string indicates an invalid amount of bits left
Reviewed-by: Matt Caswell <matt@openssl.org>
2014-12-18 15:12:34 +01:00
Emilia Kasper
d8c8a718a2 Revert "RT3425: constant-time evp_enc"
Causes more problems than it fixes: even though error codes
are not part of the stable API, several users rely on the
specific error code, and the change breaks them. Conversely,
we don't have any concrete use-cases for constant-time behaviour here.

This reverts commit b55ff319f880adc874b8c95957adf2003117d42b.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-12-17 14:56:46 +01:00
Adam Langley
40c2812f56 Premaster secret handling fixes
From BoringSSL
- Send an alert when the client key exchange isn't correctly formatted.
- Reject overly short RSA ciphertexts to avoid a (benign) out-of-bounds memory access.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit 4aecfd4d9f366c849c9627ab666d1b1addc024e6)
2014-12-17 14:04:14 +01:00
Matt Caswell
2e3e3d278e Add OPENSSL_NO_ECDH guards
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 7f9edfd23a9b9cd0827cc381e8fbd8cd0c9e5035)
2014-12-16 10:22:20 +00:00
Matt Caswell
2ececf59de Remove extraneous white space, and add some braces
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 55e530265a7ea8f264717a4e37338cc04eca2007)
2014-12-16 00:11:02 +00:00
Matt Caswell
a60536348b DTLS fixes for signed/unsigned issues
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 1904d21123849a65dafde1705e6dd5b7c2f420eb)
2014-12-16 00:11:02 +00:00
Matt Caswell
9d410579a7 Checkout return value of dtls1_output_cert_chain
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 9beb948c0dae6056caddf46a9aa099e18905d184)
2014-12-15 21:29:49 +00:00
Matt Caswell
4f90ef0c5b Check return value of ssl3_output_cert_chain
Based on commit 66f96fe2d519147097c118d4bf60704c69ed0635 by Steve Henson

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit ce5ddefc4394a0ae6c79efaffe08cf47ac659ea0)
2014-12-15 21:29:49 +00:00
Matt Caswell
eae2bb2f1f Fix memory leak in s2_srvr.c if BUF_MEM_grow fails
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2)
2014-12-13 00:06:10 +00:00
Matt Caswell
c313270836 Fixed memory leak if BUF_MEM_grow fails
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c)
2014-12-13 00:06:10 +00:00
Matt Caswell
af8a66d10d Fix use of NULL memory pointer in X509_VERIFY_PARAM_new in the event of a
malloc failure.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit c6a84ff3516d8ecd92d866b6f0ae0d63df6d9c53)
2014-12-12 23:52:41 +00:00
Matt Caswell
ec5c25b3b4 Fixed memory leak in the event of a failure of BUF_MEM_grow
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 41bf25013032da0eeb111ce3c8fc0946c0e61c41)
2014-12-08 16:51:01 +00:00
Matt Caswell
38afaa48ec Fix memory leak in SSL_new if errors occur.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 76e6509085ea96df0ca542568ee2596343711307)
2014-12-08 16:51:01 +00:00
Matt Caswell
954818fe60 Remove incorrect code inadvertently introduced through commit 59669b6ab.
Reviewed-by: Tim Hudson <tjh@openssl.org>

Conflicts:
	ssl/d1_lib.c
2014-12-04 14:25:09 +00:00
Matt Caswell
027381f68c Remove "#if 0" code
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 4bb8eb9ce4f794fecf020a15b54e8505fced0edf)
2014-12-03 09:43:49 +00:00
Matt Caswell
a900b3b51c Only use the fallback mtu after 2 unsuccessful retransmissions if it is less
than the mtu we are already using

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 047f21593eebbc617a410a208ded01e65ca11028)
2014-12-03 09:43:49 +00:00
Matt Caswell
82d7247fc5 Updates to s_client and s_server to remove the constant 28 (for IPv4 header
and UDP header) when setting an mtu. This constant is not always correct (e.g.
if using IPv6). Use the new DTLS_CTRL functions instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 464ce92026bd0c79186cbefa75470f39607110be)
2014-12-03 09:43:49 +00:00