summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-07-30Make auto DH work with DHEPSKDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Check for kECDH with extensions.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Enable PSK if corresponding mask set.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Disable all PSK if no callback.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Disable unsupported PSK algorithmsDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30new PSK text constantsDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30New PSK aliases.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30fields for PSK key, new constantsDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Fix write failure handling in DTLS1.2Matt Caswell
The DTLS code is supposed to drop packets if we try to write them out but the underlying BIO write buffers are full. ssl3_write_pending() contains an incorrect test for DTLS that controls this. The test only checks for DTLS1 so DTLS1.2 does not correctly clear the internal OpenSSL buffer which can later cause an assert to be hit. This commit changes the test to cover all DTLS versions. RT#3967 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-07-28Allow any order for signature algorithm string.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-27Remove support for SSL3_FLAGS_DELAY_CLIENT_FINISHEDMatt Caswell
This flag was not set anywhere within the codebase (only read). It could only be set by an app reaching directly into s->s3->flags and setting it directly. However that method became impossible when libssl was opaquified. Even in 1.0.2/1.0.1 if an app set the flag directly it is only relevant to ssl3_connect(), which calls SSL_clear() during initialisation that clears any flag settings. Therefore it could take effect if the app set the flag after the handshake has started but before it completed. It seems quite unlikely that any apps really do this (especially as it is completely undocumented). The purpose of the flag is suppress flushing of the write bio on the client side at the end of the handshake after the client has written the Finished message whilst resuming a session. This enables the client to send application data as part of the same flight as the Finished message. This flag also controls the setting of a second flag SSL3_FLAGS_POP_BUFFER. There is an interesting comment in the code about this second flag in the implementation of ssl3_write: /* This is an experimental flag that sends the * last handshake message in the same packet as the first * use data - used to see if it helps the TCP protocol during * session-id reuse */ It seems the experiment did not work because as far as I can tell nothing is using this code. The above comment has been in the code since SSLeay. This commit removes support for SSL3_FLAGS_DELAY_CLIENT_FINISHED, as well as the associated SSL3_FLAGS_POP_BUFFER. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-07-21free names before contextDr. Stephen Henson
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-07-21typoDr. Stephen Henson
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-07-21SSL_CONF additions.Dr. Stephen Henson
Add support for loading verify and chain stores in SSL_CONF. Commands to set verify mode and client CA names. Add documentation. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-07-18Use uint32_t consistently for flags.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
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>