summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-01-22Rerun util/openssl-format-source -v -c .OpenSSL_1_0_0-post-auto-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Yet more changes to commentsOpenSSL_1_0_0-pre-auto-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More tweaks for comments due indent issuesMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Tweaks for comments due to indent's inability to handle themMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Move more comments that confuse indentMatt Caswell
Conflicts: crypto/dsa/dsa.h demos/engines/ibmca/hw_ibmca.c ssl/ssl_locl.h Conflicts: crypto/bn/rsaz_exp.c crypto/evp/e_aes_cbc_hmac_sha1.c crypto/evp/e_aes_cbc_hmac_sha256.c ssl/ssl_locl.h Conflicts: crypto/ec/ec2_oct.c crypto/ec/ecp_nistp256.c crypto/ec/ecp_nistp521.c crypto/ec/ecp_nistputil.c crypto/ec/ecp_oct.c crypto/modes/gcm128.c ssl/ssl_locl.h Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix indent comment corruption issueMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix strange formatting by indentMatt Caswell
Conflicts: crypto/hmac/hmac.h Conflicts: crypto/evp/e_aes_cbc_hmac_sha256.c Conflicts: crypto/ec/ecp_nistp224.c crypto/ec/ecp_nistp256.c crypto/ec/ecp_nistp521.c crypto/ec/ectest.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22indent has problems with comments that are on the right hand side of a line.Matt Caswell
Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Conflicts: crypto/bn/bn.h crypto/ec/ec_lcl.h crypto/rsa/rsa.h demos/engines/ibmca/hw_ibmca.c ssl/ssl.h ssl/ssl3.h Conflicts: crypto/ec/ec_lcl.h ssl/tls1.h Conflicts: crypto/ec/ecp_nistp224.c crypto/evp/evp.h ssl/d1_both.c ssl/ssl.h ssl/ssl_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix source where indent will not be able to copeMatt Caswell
Conflicts: apps/ciphers.c ssl/s3_pkt.c Conflicts: crypto/ec/ec_curve.c Conflicts: crypto/ec/ec_curve.c ssl/s3_clnt.c ssl/s3_srvr.c ssl/ssl_sess.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Additional comment changes for reformat of 1.0.0Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Further comment amendments to preserve formatting prior to source reformatMatt Caswell
(cherry picked from commit 4a7fa26ffd65bf36beb8d1cb8f29fc0ae203f5c5) Conflicts: crypto/x509v3/pcy_tree.c Conflicts: apps/apps.c ssl/ssltest.c Conflicts: apps/apps.c crypto/ec/ec2_oct.c crypto/ec/ecp_nistp224.c crypto/ec/ecp_nistp256.c crypto/ec/ecp_nistp521.c ssl/s3_cbc.c ssl/ssl_sess.c ssl/t1_lib.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22mark all block comments that need format preserving so thatTim Hudson
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-08A memory leak can occur in dtls1_buffer_record if either of the calls toMatt Caswell
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-08Unauthenticated DH client certificate fix.Dr. Stephen Henson
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-08Follow on from CVE-2014-3571. This fixes the code that was the original sourceMatt Caswell
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-08Fix crash in dtls1_get_record whilst in the listen state where you get twoDr. Stephen Henson
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-07fix error discrepancyDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 4a4d4158572fd8b3dc641851b8378e791df7972d)
2015-01-06Only allow ephemeral RSA keys in export ciphersuites.Dr. Stephen Henson
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-05ECDH downgrade bug fix.Dr. Stephen Henson
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
2014-12-17Premaster secret handling fixesAdam Langley
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-16Add OPENSSL_NO_ECDH guardsMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 7f9edfd23a9b9cd0827cc381e8fbd8cd0c9e5035)
2014-12-16Remove extraneous white space, and add some bracesMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 55e530265a7ea8f264717a4e37338cc04eca2007)
2014-12-16DTLS fixes for signed/unsigned issuesMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 1904d21123849a65dafde1705e6dd5b7c2f420eb)
2014-12-15Checkout return value of dtls1_output_cert_chainMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 9beb948c0dae6056caddf46a9aa099e18905d184)
2014-12-15Check return value of ssl3_output_cert_chainMatt Caswell
Based on commit 66f96fe2d519147097c118d4bf60704c69ed0635 by Steve Henson Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit ce5ddefc4394a0ae6c79efaffe08cf47ac659ea0)
2014-12-13Fix memory leak in s2_srvr.c if BUF_MEM_grow failsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit d04a1e0b5beb3329cdf8c4ec35b9113cbc41d2f2)
2014-12-13Fixed memory leak if BUF_MEM_grow failsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit bb1ddd3d9a0d01656b90693a214b911995a5fe8c)
2014-12-08Fixed memory leak in the event of a failure of BUF_MEM_growMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 41bf25013032da0eeb111ce3c8fc0946c0e61c41)
2014-12-08Fix memory leak in SSL_new if errors occur.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 76e6509085ea96df0ca542568ee2596343711307)
2014-12-04Remove incorrect code inadvertently introduced through commit 59669b6ab.Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Conflicts: ssl/d1_lib.c
2014-12-03Remove "#if 0" codeMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 4bb8eb9ce4f794fecf020a15b54e8505fced0edf)
2014-12-03Only use the fallback mtu after 2 unsuccessful retransmissions if it is lessMatt Caswell
than the mtu we are already using Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 047f21593eebbc617a410a208ded01e65ca11028)
2014-12-03If we really get a situation where the underlying mtu is less than the minimumMatt Caswell
we will support then dtls1_do_write can go into an infinite loop. This commit fixes that. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit d3d9eef31661633f5b003a9e115c1822f79d1870)
2014-12-03Fix dtls_query_mtu so that it will always either complete with an mtu that isMatt Caswell
at least the minimum or it will fail. There were some instances in dtls1_query_mtu where the final mtu can end up being less than the minimum, i.e. where the user has set an mtu manually. This shouldn't be allowed. Also remove dtls1_guess_mtu that, despite having logic for guessing an mtu, was actually only ever used to work out the minimum mtu to use. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 1620a2e49c777f31f2ce57966ae74006b48ad759)
2014-12-03Remove instances in libssl of the constant 28 (for size of IPv4 header + UDP)Matt Caswell
and instead use the value provided by the underlying BIO. Also provide some new DTLS_CTRLs so that the library user can set the mtu without needing to know this constant. These new DTLS_CTRLs provide the capability to set the link level mtu to be used (i.e. including this IP/UDP overhead). The previous DTLS_CTRLs required the library user to subtract this overhead first. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 59669b6abf620d1ed2ef4d1e2df25c998b89b64d) Conflicts: ssl/d1_both.c ssl/ssl.h ssl/ssl_lib.c
2014-12-03The first call to query the mtu in dtls1_do_write correctly checks that theMatt Caswell
mtu that we have received is not less than the minimum. If its less it uses the minimum instead. The second call to query the mtu does not do that, but instead uses whatever comes back. We have seen an instance in RT#3592 where we have got an unreasonably small mtu come back. This commit makes both query checks consistent. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 6abb0d1f8e702a0daa9c32b8021d01eda0483018)
2014-12-03The SSL_OP_NO_QUERY_MTU option is supposed to stop the mtu from beingMatt Caswell
automatically updated, and we should use the one provided instead. Unfortunately there are a couple of locations where this is not respected. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 001235778a6e9c645dc0507cad6092d99c9af8f5)
2014-12-03Verify that we have a sensible message len and fail if notMatt Caswell
RT#3592 provides an instance where the OPENSSL_assert that this commit replaces can be hit. I was able to recreate this issue by forcing the underlying BIO to misbehave and come back with very small mtu values. This happens the second time around the while loop after we have detected that the MTU has been exceeded following the call to dtls1_write_bytes. Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit cf75017bfd60333ff65edf9840001cd2c49870a3)
2014-11-28[PR3597] Advance to the next state variant when reusing messages.Richard Levitte
Previously, state variant was not advanced, which resulted in state being stuck in the st1 variant (usually "_A"). This broke certificate callback retry logic when accepting connections that were using SSLv2 ClientHello (hence reusing the message), because their state never advanced to SSL3_ST_SR_CLNT_HELLO_C variant required for the retry code path. Reported by Yichun Zhang (agentzh). Signed-off-by: Piotr Sikora <piotr@cloudflare.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-27Fixed warning in ssl2_encMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 2db95e094d23b41d2305c0a01db66694ea77f936)
2014-11-27Check EVP_Cipher return values for SSL2Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 5fc8bb6ab71b5f7ce2dd67a47494bb5b5c6dc374)
2014-11-27Add checks to the return value of EVP_Cipher to prevent silent encryption ↵Matt Caswell
failure. PR#1767 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 244d0955adc027c0f41a3251e55d145bf940f9ce)
2014-11-27Remove redundant checks in ssl_cert_dup. This was causing spurious error ↵Matt Caswell
messages when using GOST PR#3613 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit fc3968a25ce0c16cab8730ec0d68a59856158029)
2014-11-26Fixed memory leak due to incorrect freeing of DTLS reassembly bit maskMatt Caswell
PR#3608 Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 8a35dbb6d89a16d792b79b157b3e89443639ec94)
2014-11-25Corrected comments in ssl.h about SSLv23_method and friendsMatt Caswell
PR#3574 Reviewed-by: Dr. Stephen Henson <steve@openssl.org> (cherry picked from commit 3a0765882c4b3b67960b7efb203570764dd4ed29)
2014-10-21Fix and improve SSL_MODE_SEND_FALLBACK_SCSV documentation.Bodo Moeller
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-21When processing ClientHello.cipher_suites, don't ignore cipher suitesBodo Moeller
listed after TLS_FALLBACK_SCSV. RT: 3575 Reviewed-by: Emilia Kasper <emilia@openssl.org>
2014-10-21Keep old method in case of an unsupported protocolKurt Roeckx
When we're configured with no-ssl3 and we receive an SSL v3 Client Hello, we set the method to NULL. We didn't used to do that, and it breaks things. This is a regression introduced in 62f45cc27d07187b59551e4fad3db4e52ea73f2c. Keep the old method since the code is not able to deal with a NULL method at this time. CVE-2014-3569, PR#3571 Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 392fa7a952e97d82eac6958c81ed1e256e6b8ca5)
2014-10-15Fix no-ssl3 configuration optionGeoff Thorpe
CVE-2014-3568 Reviewed-by: Emilia Kasper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>