summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-06-30Dup peer_chain properly in SSL_SESSIONDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-29Use single master secret generation function.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23Fix PSK client handling.Dr. Stephen Henson
The PSK identity hint should be stored in the SSL_SESSION structure and not in the parent context (which will overwrite values used by other SSL structures with the same SSL_CTX). Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23Add PSK GCM ciphersuites from RFC5487Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23PSK trace keyex fixes.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23Avoid duplication.Dr. Stephen Henson
We always free the handshake buffer when digests are freed so move it into ssl_free_digest_list() Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-23Tidy up ssl3_digest_cached_records logic.Dr. Stephen Henson
Rewrite ssl3_digest_cached_records handling. Only digest cached records if digest array is NULL: this means it is safe to call ssl3_digest_cached_records multiple times (subsequent calls are no op). Remove flag TLS1_FLAGS_KEEP_HANDSHAKE instead only update handshake buffer if digest array is NULL. Add additional "keep" parameter to ssl3_digest_cached_records to indicate if the handshake buffer should be retained after digesting cached records (needed for TLS 1.2 client authentication). Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-22Remove SESS_CERT entirely.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-22Move peer chain to SSL_SESSION structure.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-22Remove unnuecessary ifdefs.Dr. Stephen Henson
If RSA or DSA is disabled we will never use a ciphersuite with RSA/DSA authentication as it is already filtered out by the cipher list logic. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-22Remove certificates from sess_certDr. Stephen Henson
As numerous comments indicate the certificate and key array is not an appopriate structure to store the peers certificate: so remove it and just the s->session->peer instead. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-22Remove peer temp keys from SESS_CERTDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-21Revert "Avoid duplication."Dr. Stephen Henson
This reverts commit d480e182fe20fcaeca7817a4693eeaf594bb1a32. Commit broke TLS handshakes due to fragility of digest caching: that will be fixed separately. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-21Avoid duplication.Dr. Stephen Henson
We always free the handshake buffer when digests are freed so move it into ssl_free_digest_list() Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-21remove unnecessary NULL checksDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-20typo: should be OPENSSL_freeDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-06-15Refactor into clear_ciphers; RT3588Rich Salz
While closing RT3588 (Remove obsolete comment) Kurt and I saw that a few lines to completely clear the SSL cipher state could be moved into a common function. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-06-12Allow a zero length extension blockAdam Langley
It is valid for an extension block to be present in a ClientHello, but to be of zero length. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-06-11More ssl_session_dup fixesMatt Caswell
Fix error handling in ssl_session_dup, as well as incorrect setting up of the session ticket. Follow on from CVE-2015-1791. Thanks to LibreSSL project for reporting these issues. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-10Tidy disabled algorithm handling.Dr. Stephen Henson
Determine disabled algorithm masks when algorithms are loaded instead of recalculating them each time. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-10Restore GOST mac setup.Dr. Stephen Henson
Restore GOST mac setup which was accidentally removed during cipher refactor. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-10Remove SSL_OP_TLS_BLOCK_PADDING_BUGEmilia Kasper
This is a workaround so old that nobody remembers what buggy clients it was for. It's also been broken in stable branches for two years and nobody noticed (see https://boringssl-review.googlesource.com/#/c/1694/). Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-10DTLS handshake message fragments musn't span packetsMatt Caswell
It should not be possible for DTLS message fragments to span multiple packets. However previously if the message header fitted exactly into one packet, and the fragment body was in the next packet then this would work. Obviously this would fail if packets get re-ordered mid-flight. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-10Correct type of RECORD_LAYER_get_rrec_length()Matt Caswell
The underlying field returned by RECORD_LAYER_get_rrec_length() is an unsigned int. The return type of the function should match that. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-06-10Tighten extension handlingMatt Caswell
This adds additional checks to the processing of extensions in a ClientHello to ensure that either no extensions are present, or if they are then they take up the exact amount of space expected. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-06-09Only allow a temporary rsa key exchange when they key is larger than 512.Kurt Roeckx
Reviewed-by: Matt Caswell <matt@openssl.org> MR #588
2015-06-09Properly check certificate in case of export ciphers.Kurt Roeckx
Reviewed-by: Matt Caswell <matt@openssl.org> MR #588
2015-06-08Use CRYPTO_memcmp in ssl3_record.cEmilia Kasper
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-06Update trace code.Dr. Stephen Henson
Add extension and ciphersuites to trace code. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-04Allow all curves when the client doesn't send an supported elliptic curves ↵Kurt Roeckx
extension At least in the case of SSLv3 we can't send an extention. Reviewed-by: Matt Caswell <matt@openssl.org> MR #811
2015-06-04Remove misleading commentMatt Caswell
Remove a comment that suggested further clean up was required. DH_free() performs the necessary cleanup. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-04Clean premaster_secret for GOSTMatt Caswell
Ensure OPENSSL_cleanse() is called on the premaster secret value calculated for GOST. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-06-04Fix DTLS session resumptionMatt Caswell
The session object on the client side is initially created during construction of the ClientHello. If the client is DTLS1.2 capable then it will store 1.2 as the version for the session. However if the server is only DTLS1.0 capable then when the ServerHello comes back the client switches to using DTLS1.0 from then on. However the session version does not get updated. Therefore when the client attempts to resume that session the server throws an alert because of an incorrect protocol version. Reviewed-by: Tim Hudson <tjh@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>
2015-06-01Check the message type requested is the type received in DTLSMatt Caswell
dtls1_get_message has an |mt| variable which is the type of the message that is being requested. If it is negative then any message type is allowed. However the value of |mt| is not checked in one of the main code paths, so a peer can send a message of a completely different type and it will be processed as if it was the message type that we were expecting. This has very little practical consequences because the current behaviour will still fail when the format of the message isn't as expected. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-05-31Silence Clang warning about unit'd variableRich Salz
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-30clear/cleanse cleanupRich Salz
Where we called openssl_cleanse, make sure we do it on all error paths. Be consistent in use of sizeof(foo) when possible. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-05-29Remove struct ccs_header_stMatt Caswell
struct ccs_header_st is not used so it should be removed. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-28Change return type of the new accessorsMatt Caswell
The new accessors SSL_get_client_random, SSL_get_server_random and SSL_SESSION_get_master_key should return a size_t to match the type of the |outlen| parameter. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-28Change the new functions to use size_tMatt Caswell
Change the new SSL_get_client_random(), SSL_get_server_random() and SSL_SESSION_get_master_key() functions to use size_t for |outlen| instead of int. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-28Add new functions to extract {client,server}_random, master_keyNick Mathewson
Tor uses these values to implement a low-rent clone of RFC 5705 (which, in our defense, we came up with before RFC 5705 existed). But now that ssl_st is opaque, we need another way to get at them. Includes documentation, with suitable warnings about not actually using these functions. Signed-off-by: Nick Mathewson <nickm@torproject.org> Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-28Add SSL_get_client_ciphers() to return ciphers from ClientHelloNick Mathewson
On the server side, if you want to know which ciphers the client offered, you had to use session->ciphers. But that field is no longer visible, so we need a method to get at it. Signed-off-by: Nick Mathewson <nickm@torproject.org> Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-26Don't check for a negative SRP extension sizeMatt Caswell
The size of the SRP extension can never be negative (the variable |size| is unsigned). Therefore don't check if it is less than zero. RT#3862 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-25Don't send an alert if we've just received oneMatt Caswell
If the record received is for a version that we don't support, previously we were sending an alert back. However if the incoming record already looks like an alert then probably we shouldn't do that. So suppress an outgoing alert if it looks like we've got one incoming. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-24Set first_packet for TLS clientsMatt Caswell
Version negotiation was broken (one of the late changes in the review process broke it). The problem is that TLS clients do not set first_packet, whereas TLS/DTLS servers and DTLS clients do. The simple fix is to set first_packet for TLS clients too. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-22Fix typo setting up certificate masksMatt Caswell
The certificate masks are used to select which ciphersuite we are going to use. The variables |emask_k| and |emask_a| relate to export grade key exchange and authentication respecitively. The variables |mask_k| and |mask_a| are the equivalent versions for non-export grade. This fixes an instance where the two usages of export/non-export were mixed up. In practice it makes little difference since it still works! Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Remove export static DH ciphersuitesMatt Caswell
Remove support for the two export grade static DH ciphersuites. These two ciphersuites were newly added (along with a number of other static DH ciphersuites) to 1.0.2. However the two export ones have *never* worked since they were introduced. It seems strange in any case to be adding new export ciphersuites, and given "logjam" it also does not seem correct to fix them. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Add CHANGES entry for OPENSSL_NO_TLSEXT removalMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Remove support for OPENSSL_NO_TLSEXTMatt Caswell
Given the pervasive nature of TLS extensions it is inadvisable to run OpenSSL without support for them. It also means that maintaining the OPENSSL_NO_TLSEXT option within the code is very invasive (and probably not well tested). Therefore it is being removed. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-22Fix the update target and remove duplicate file updatesRichard Levitte
We had updates of certain header files in both Makefile.org and the Makefile in the directory the header file lived in. This is error prone and also sometimes generates slightly different results (usually just a comment that differs) depending on which way the update was done. This removes the file update targets from the top level Makefile, adds an update: target in all Makefiles and has it depend on the depend: or local_depend: targets, whichever is appropriate, so we don't get a double run through the whole file tree. Reviewed-by: Rich Salz <rsalz@openssl.org>