summaryrefslogtreecommitdiffstats
path: root/ssl/ssl.h
AgeCommit message (Collapse)Author
2016-08-19Update function error codeMatt Caswell
A function error code needed updating due to merge issues. Reviewed-by: Richard Levitte <levitte@openssl.org>
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>
2016-03-14Add no-ssl2-methodKurt Roeckx
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> MR: #2341 (cherry picked from commit 4256957570a233ed4e9840353e95e623dfd62086)
2016-03-09expose SSLv2 method prototypesViktor Dukhovni
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-03-07Remove LOW from the defaultKurt Roeckx
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (cherry picked from commit 29cce508972f61511318bf8cf7011fae027cddb2)
2016-01-28Always generate DH keys for ephemeral DH cipher suitesMatt Caswell
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. This is a follow on from CVE-2016-0701. This branch is not impacted by that CVE because it does not support X9.42 style parameters. It is still possible to generate parameters based on primes that are not "safe", although by default OpenSSL does not do this. The documentation does sign post that using such parameters is unsafe if the private DH key is reused. However to avoid accidental problems or future attacks this commit has been backported to this branch. Issue reported by Antonio Sanso Reviewed-by: Viktor Dukhovni <viktor@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-05-05Add Error stateMatt Caswell
Reusing an SSL object when it has encountered a fatal error can have bad consequences. This is a bug in application code not libssl but libssl should be more forgiving and not crash. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a89db885e0d8aac3a9df1bbccb0c1ddfd8b2e10a) Conflicts: ssl/s3_srvr.c ssl/ssl_stat.c
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-03-07Remove export ciphers from the DEFAULT cipher listKurt Roeckx
They are moved to the COMPLEMENTOFDEFAULT instead. This also fixes SSLv2 to be part of COMPLEMENTOFDEFAULT. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit f417997a324037025be61737288e40e171a8218c) Conflicts: ssl/ssl_ciph.c
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More tweaks for comments due indent issuesOpenSSL_1_0_1-pre-auto-reformatMatt 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 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix indent comment corruption issueMatt Caswell
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 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Further comment changes for reformatMatt Caswell
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 Reviewed-by: Tim Hudson <tjh@openssl.org>
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: doc/ssl/SSL_CTX_set_options.pod
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_lib.c
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-11-19New option no-ssl3-method which removes SSLv3_*methodDr. Stephen Henson
When no-ssl3 is set only make SSLv3 disabled by default. Retain -ssl3 options for s_client/s_server/ssltest. When no-ssl3-method is set SSLv3_*method() is removed and all -ssl3 options. We should document this somewhere, e.g. wiki, FAQ or manual page. Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 3881d8106df732fc433d30446625dfa2396da42d) Conflicts: util/mkdef.pl
2014-10-21Fix and improve SSL_MODE_SEND_FALLBACK_SCSV documentation.Bodo Moeller
Reviewed-by: Rich Salz <rsalz@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-07-24Add conditional unit testing interface.Dr. Stephen Henson
Don't call internal functions directly call them through SSL_test_functions(). This also makes unit testing work on Windows and platforms that don't export internal functions from shared libraries. By default unit testing is not enabled: it requires the compile time option "enable-unit-test". Reviewed-by: Geoff Thorpe <geoff@openssl.org> (cherry picked from commit e0fc7961c4fbd27577fb519d9aea2dc788742715) Conflicts: ssl/Makefile util/mkdef.pl
2014-06-09SRP ciphersuite correction.Dr. Stephen Henson
SRP ciphersuites do not have no authentication. They have authentication based on SRP. Add new SRP authentication flag and cipher string. (cherry picked from commit a86b88acc373ac1fb0ca709a5fb8a8fa74683f67)
2014-06-01Option to disable padding extension.Dr. Stephen Henson
Add TLS padding extension to SSL_OP_ALL so it is used with other "bugs" options and can be turned off. This replaces SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG which is an ancient option referring to SSLv2 and SSLREF. PR#3336
2014-03-10typoDr. Stephen Henson
(cherry picked from commit a029788b0e0c19cee4007cc1f73201cf2c13addf)
2014-01-04Restore SSL_OP_MSIE_SSLV2_RSA_PADDINGDr. Stephen Henson
The flag SSL_OP_MSIE_SSLV2_RSA_PADDING hasn't done anything since OpenSSL 0.9.7h but deleting it will break source compatibility with any software that references it. Restore it but #define to zero. (cherry picked from commit b17d6b8d1d49fa4732deff17cfd1833616af0d9c)
2013-10-19Merge branch 'no_gmt_unix_time' of git://github.com/nmathewson/openssl into ↵Ben Laurie
OpenSSL_1_0_1-stable
2013-10-09Control sending time with SSL_SEND_{CLIENT,SERVER}RANDOM_MODENick Mathewson
(I'd rather use an option, but it appears that the options field is full.) Now, we send the time in the gmt_unix_time field if the appropriate one of these mode options is set, but randomize the field if the flag is not set.
2013-09-16Don't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X.Rob Stradling
OS X 10.8..10.8.3 has broken support for ECDHE-ECDSA ciphers.
2013-02-04Fix error codes.Dr. Stephen Henson
2012-06-08Reduce version skew.Ben Laurie
2012-04-25Change value of SSL_OP_NO_TLSv1_1 to avoid clash with SSL_OP_ALL andDr. Stephen Henson
OpenSSL 1.0.0. Add CHANGES entry noting the consequences.
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-12-23typoDr. Stephen Henson
2011-12-23delete unimplemented function from header file, update ordinalsDr. Stephen Henson
2011-12-22remove prototype for deleted SRP functionDr. Stephen Henson
2011-12-22New ctrl values to clear or retrieve extra chain certs from an SSL_CTX.Dr. Stephen Henson
New function to retrieve compression method from SSL_SESSION structure. Delete SSL_SESSION_get_id_len and SSL_SESSION_get0_id functions as they duplicate functionality of SSL_SESSION_get_id. Note: these functions have never appeared in any release version of OpenSSL.
2011-12-14PR: 1794Dr. Stephen Henson
Submitted by: Peter Sylvester <peter.sylvester@edelweb.fr> Reviewed by: steve Remove unnecessary code for srp and to add some comments to s_client. - the callback to provide a user during client connect is no longer necessary since rfc 5054 a connection attempt with an srp cipher and no user is terminated when the cipher is acceptable - comments to indicate in s_client the (non-)usefulness of th primalaty tests for non known group parameters.
2011-12-13Remove redundant TLS exporter.Ben Laurie
2011-12-02Fix exporter.Ben Laurie