summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_err.c
AgeCommit message (Collapse)Author
2016-08-19Fix DTLS replay protectionMatt Caswell
The DTLS implementation provides some protection against replay attacks in accordance with RFC6347 section 4.1.2.6. A sliding "window" of valid record sequence numbers is maintained with the "right" hand edge of the window set to the highest sequence number we have received so far. Records that arrive that are off the "left" hand edge of the window are rejected. Records within the window are checked against a list of records received so far. If we already received it then we also reject the new record. If we have not already received the record, or the sequence number is off the right hand edge of the window then we verify the MAC of the record. If MAC verification fails then we discard the record. Otherwise we mark the record as received. If the sequence number was off the right hand edge of the window, then we slide the window along so that the right hand edge is in line with the newly received sequence number. Records may arrive for future epochs, i.e. a record from after a CCS being sent, can arrive before the CCS does if the packets get re-ordered. As we have not yet received the CCS we are not yet in a position to decrypt or validate the MAC of those records. OpenSSL places those records on an unprocessed records queue. It additionally updates the window immediately, even though we have not yet verified the MAC. This will only occur if currently in a handshake/renegotiation. This could be exploited by an attacker by sending a record for the next epoch (which does not have to decrypt or have a valid MAC), with a very large sequence number. This means the right hand edge of the window is moved very far to the right, and all subsequent legitimate packets are dropped causing a denial of service. A similar effect can be achieved during the initial handshake. In this case there is no MAC key negotiated yet. Therefore an attacker can send a message for the current epoch with a very large sequence number. The code will process the record as normal. If the hanshake message sequence number (as opposed to the record sequence number that we have been talking about so far) is in the future then the injected message is bufferred to be handled later, but the window is still updated. Therefore all subsequent legitimate handshake records are dropped. This aspect is not considered a security issue because there are many ways for an attacker to disrupt the initial handshake and prevent it from completing successfully (e.g. injection of a handshake message will cause the Finished MAC to fail and the handshake to be aborted). This issue comes about as a result of trying to do replay protection, but having no integrity mechanism in place yet. Does it even make sense to have replay protection in epoch 0? That issue isn't addressed here though. This addressed an OCAP Audit issue. CVE-2016-2181 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-11-20Ensure all EVP calls have their returns checked where appropriateMatt Caswell
There are lots of calls to EVP functions from within libssl There were various places where we should probably check the return value but don't. This adds these checks. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 56d913467541506572f908a34c32ca7071f77a94) Conflicts: ssl/s3_enc.c ssl/s3_srvr.c
2015-08-11Fix seg fault with 0 p val in SKEGuy Leaver (guleaver)
If a client receives a ServerKeyExchange for an anon DH ciphersuite with the value of p set to 0 then a seg fault can occur. This commits adds a test to reject p, g and pub key parameters that have a 0 value (in accordance with RFC 5246) The security vulnerability only affects master and 1.0.2, but the fix is additionally applied to 1.0.1 for additional confidence. CVE-2015-1794 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-02Fix race condition in NewSessionTicketMatt Caswell
If a NewSessionTicket is received by a multi-threaded client when attempting to reuse a previous ticket then a race condition can occur potentially leading to a double free of the ticket data. CVE-2015-1791 This also fixes RT#3808 where a session ID is changed for a session already in the client session cache. Since the session ID is the key to the cache this breaks the cache access. Parts of this patch were inspired by this Akamai change: https://github.com/akamai/openssl/commit/c0bf69a791239ceec64509f9f19fcafb2461b0d3 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 27c76b9b8010b536687318739c6f631ce4194688) Conflicts: ssl/ssl.h ssl/ssl_err.c
2015-05-20client: reject handshakes with DH parameters < 768 bits.Emilia Kasper
Since the client has no way of communicating her supported parameter range to the server, connections to servers that choose weak DH will simply fail. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-04-21Repair EAP-FAST session resumptionEmilia Kasper
EAP-FAST session resumption relies on handshake message lookahead to determine server intentions. Commits 980bc1ec6114f5511b20c2e6ca741e61a39b99d6 and 7b3ba508af5c86afe43e28174aa3c53a0a24f4d9 removed the lookahead so broke session resumption. This change partially reverts the commits and brings the lookahead back in reduced capacity for TLS + EAP-FAST only. Since EAP-FAST does not support regular session tickets, the lookahead now only checks for a Finished message. Regular handshakes are unaffected by this change. Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 6e3d015363ed09c4eff5c02ad41153387ffdf5af)
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-10-15Support TLS_FALLBACK_SCSV.Bodo Moeller
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-08-06Check SRP parameters early.Dr. Stephen Henson
Check SRP parameters when they are received so we can send back an appropriate alert. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2014-05-01Fixed spelling error in error message. Fix supplied by Marcos MaradoMatt Caswell
2013-02-04Fix error codes.Dr. Stephen Henson
2012-04-18correct error codeDr. Stephen Henson
2012-02-22ABI compliance fixes.Dr. Stephen Henson
Move new structure fields to end of structures. Import library codes from 1.0.0 and recreate new ones.
2012-02-10Submitted by: Eric Rescorla <ekr@rtfm.com>Dr. Stephen Henson
Fix encoding of use_srtp extension to be compliant with RFC5764
2012-01-04Only allow one SGC handshake restart for SSL/TLS. (CVE-2011-4619)Dr. Stephen Henson
2011-12-31PR: 2658Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Support for TLS/DTLS heartbeats.
2011-11-15Add TLS exporter.Ben Laurie
2011-11-15Add DTLS-SRTP.Ben Laurie
2011-11-13Add Next Protocol Negotiation.Ben Laurie
2011-05-12Process signature algorithms during TLS v1.2 client authentication.Dr. Stephen Henson
Make sure message is long enough for signature algorithms. (backport from HEAD).
2011-05-11Backport TLS v1.2 support from HEAD.Dr. Stephen Henson
This includes TLS v1.2 server and client support but at present client certificate support is not implemented.
2011-05-11Initial "opaque SSL" framework. If an application defines OPENSSL_NO_SSL_INTERNDr. Stephen Henson
all ssl related structures are opaque and internals cannot be directly accessed. Many applications will need some modification to support this and most likely some additional functions added to OpenSSL. The advantage of this option is that any application supporting it will still be binary compatible if SSL structures change. (backport from HEAD).
2011-03-16Fix SRP error codes (from HEAD).Dr. Stephen Henson
2011-03-16Add SRP.Ben Laurie
2010-01-06Updates to conform with draft-ietf-tls-renegotiation-03.txt:Dr. Stephen Henson
1. Add provisional SCSV value. 2. Don't send SCSV and RI at same time. 3. Fatal error is SCSV received when renegotiating.
2010-01-01Client side compression algorithm sanity checks: ensure old compressionDr. Stephen Henson
algorithm matches current and give error if compression is disabled and server requests it (shouldn't happen unless server is broken).
2010-01-01Compression handling on session resume was badly broken: it alwaysDr. Stephen Henson
used compression algorithms in client hello (a legacy from when the compression algorithm wasn't serialized with SSL_SESSION).
2009-12-12Missing error code.Ben Laurie
2009-11-18Include a more meaningful error message when rejecting legacy renegotiationDr. Stephen Henson
2009-11-09First cut of renegotiation extension. (port to 1.0.0-stable)Dr. Stephen Henson
2009-09-06Make update, deleting bogus DTLS error codeDr. Stephen Henson
2009-08-26PR: 2006Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org Do not use multiple DTLS records for a single user message
2009-08-12Update default dependency flags.Dr. Stephen Henson
Make error name discrepancies a fatal error. Fix error codes. make update
2009-07-15Fix error codes and indentation.Dr. Stephen Henson
2009-04-05Fix error codes.Dr. Stephen Henson
2008-12-27Deal with the unlikely event that EVP_MD_CTX_size() returns an error.Ben Laurie
(Coverity ID 140).
2008-12-27Handle the unlikely event that BIO_get_mem_data() returns -ve.Ben Laurie
2008-11-15PR: 1574Dr. Stephen Henson
Submitted by: Jouni Malinen <j@w1.fi> Approved by: steve@openssl.org Ticket override support for EAP-FAST.
2008-08-13sanity checkBodo Möller
PR: 1679
2008-08-04Fix error codes for memory-saving patch.Bodo Möller
Also, get rid of compile-time switch OPENSSL_NO_RELEASE_BUFFERS because it was rather pointless (the new behavior has to be explicitly requested by setting SSL_MODE_RELEASE_BUFFERS anyway).
2008-06-01Update error codes.Dr. Stephen Henson
2007-10-26Fix duplicate error codes.Dr. Stephen Henson
2007-10-261. Changes for s_client.c to make it return non-zero exit code in caseDr. Stephen Henson
of handshake failure 2. Changes to x509_certificate_type function (crypto/x509/x509type.c) to make it recognize GOST certificates as EVP_PKT_SIGN|EVP_PKT_EXCH (required for s3_srvr to accept GOST client certificates). 3. Changes to EVP - adding of function EVP_PKEY_CTX_get0_peerkey - Make function EVP_PKEY_derive_set_peerkey work for context with ENCRYPT operation, because we use peerkey field in the context to pass non-ephemeral secret key to GOST encrypt operation. - added EVP_PKEY_CTRL_SET_IV control command. It is really GOST-specific, but it is used in SSL code, so it has to go in some header file, available during libssl compilation 4. Fix to HMAC to avoid call of OPENSSL_cleanse on undefined data 5. Include des.h if KSSL_DEBUG is defined into some libssl files, to make debugging output which depends on constants defined there, work and other KSSL_DEBUG output fixes 6. Declaration of real GOST ciphersuites, two authentication methods SSL_aGOST94 and SSL_aGOST2001 and one key exchange method SSL_kGOST 7. Implementation of these methods. 8. Support for sending unsolicited serverhello extension if GOST ciphersuite is selected. It is require for interoperability with CryptoPro CSP 3.0 and 3.6 and controlled by SSL_OP_CRYPTOPRO_TLSEXT_BUG constant. This constant is added to SSL_OP_ALL, because it does nothing, if non-GOST ciphersuite is selected, and all implementation of GOST include compatibility with CryptoPro. 9. Support for CertificateVerify message without length field. It is another CryptoPro bug, but support is made unconditional, because it does no harm for draft-conforming implementation. 10. In tls1_mac extra copy of stream mac context is no more done. When I've written currently commited code I haven't read EVP_DigestSignFinal manual carefully enough and haven't noticed that it does an internal digest ctx copying. This implementation was tested against 1. CryptoPro CSP 3.6 client and server 2. Cryptopro CSP 3.0 server
2007-10-13DTLS fixes from 0.9.8-stable.Andy Polyakov
2007-09-26Support for certificate status TLS extension.Dr. Stephen Henson
2007-09-21Implement the Opaque PRF Input TLS extensionBodo Möller
(draft-rescorla-tls-opaque-prf-input-00.txt), and do some cleanups and bugfixes on the way. In particular, this fixes the buffer bounds checks in ssl_add_clienthello_tlsext() and in ssl_add_serverhello_tlsext(). Note that the opaque PRF Input TLS extension is not compiled by default; see CHANGES.
2007-09-19make errors.Ben Laurie
2007-09-19Clean up error codes a bit.Bodo Möller
(engines/ccgost/ remains utter chaos, though; "make errors" is not happy.)
2007-08-31Update ssl code to support digests other than MD5+SHA1 in handshake.Dr. Stephen Henson
Submitted by: Victor B. Wagner <vitus@cryptocom.ru>
2007-08-28Add ctrls to set and get RFC4507bis keys to enable several contexts toDr. Stephen Henson
reuse the same tickets.