summaryrefslogtreecommitdiffstats
path: root/ssl/s3_lib.c
AgeCommit message (Collapse)Author
2016-03-09Move disabling of RC4 for DTLS to the cipher list.Kurt Roeckx
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> MR: #1595
2016-03-09IDEA is not supported in TLS 1.2Kurt Roeckx
This currently seems to be the only cipher we still support that should get disabled. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> MR: #1595
2016-03-09Add support for minimum and maximum protocol version supported by a cipherKurt Roeckx
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> MR: #1595
2016-03-08GH815: The ChaCha20/Poly1305 codepoints are officialBenjamin Kaduk
CCA8, CCA9, CCAA, CCAB, CCAC, CCAD, and CCAE are now present in https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml so remove the "as per draft-ietf-tls-chacha20-poly1305-03" note accordingly. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-08GH787: Fix ALPNTodd Short
* Perform ALPN after the SNI callback; the SSL_CTX may change due to that processing * Add flags to indicate that we actually sent ALPN, to properly error out if unexpectedly received. * clean up ssl3_free() no need to explicitly clear when doing memset * document ALPN functions Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-03-07Rework the default cipherlist.Emilia Kasper
- Always prefer forward-secure handshakes. - Consistently order ECDSA above RSA. - Next, always prefer AEADs to non-AEADs, irrespective of strength. - Within AEADs, prefer GCM > CHACHA > CCM for a given strength. - Prefer TLS v1.2 ciphers to legacy ciphers. - Remove rarely used DSS, IDEA, SEED, CAMELLIA, CCM from the default list to reduce ClientHello bloat. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-04Don't mark the eNULL ciphers as non-default.Kurt Roeckx
They're not part of ALL, so they're not part of COMPLEMENTOFDEFAULT Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #2202
2016-03-04Don't build RC4 ciphersuites into libssl by defaultMatt Caswell
RC4 based ciphersuites in libssl have been disabled by default. They can be added back by building OpenSSL with the "enable-weak-ssl-ciphers" Configure option at compile time. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-24Remove unused parameter in ssl_set_masks().Dr. Stephen Henson
The ssl_set_masks() function no longer depends on the cipher. This also means there is no need to set the masks for each cipher in ssl3_choose_cipher. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18Remove outdated DEBUG flags.Rich Salz
Add -DBIO_DEBUG to --strict-warnings. Remove comments about outdated debugging ifdef guards. Remove md_rand ifdef guarding an assert; it doesn't seem used. Remove the conf guards in conf_api since we use OPENSSL_assert, not assert. For pkcs12 stuff put OPENSSL_ in front of the macro name. Merge TLS_DEBUG into SSL_DEBUG. Various things just turned on/off asserts, mainly for checking non-NULL arguments, which is now removed: camellia, bn_ctx, crypto/modes. Remove some old debug code, that basically just printed things to stderr: DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG, RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG. Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13GH675: make ssl3_ciphers staticViktor Szakats
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Remove static ECDH support.Dr. Stephen Henson
Remove support for static ECDH ciphersuites. They require ECDH keys in certificates and don't support forward secrecy. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-11Remove TLS heartbeat, disable DTLS heartbeatRich Salz
To enable heartbeats for DTLS, configure with enable-heartbeats. Heartbeats for TLS have been completely removed. This addresses RT 3647 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08Deprecate undocumented SSL_cache_hit().Dr. Stephen Henson
Deprecate undocumented SSL_cache_hit(). Make SSL_session_reused() into a real function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08Handle SSL_shutdown while in init more appropriately #2Matt Caswell
Previous commit 7bb196a71 attempted to "fix" a problem with the way SSL_shutdown() behaved whilst in mid-handshake. The original behaviour had SSL_shutdown() return immediately having taken no action if called mid- handshake with a return value of 1 (meaning everything was shutdown successfully). In fact the shutdown has not been successful. Commit 7bb196a71 changed that to send a close_notify anyway and then return. This seems to be causing some problems for some applications so perhaps a better (much simpler) approach is revert to the previous behaviour (no attempt at a shutdown), but return -1 (meaning the shutdown was not successful). This also fixes a bug where SSL_shutdown always returns 0 when shutdown *very* early in the handshake (i.e. we are still using SSLv23_method). Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-01constify PACKETEmilia Kasper
PACKET contents should be read-only. To achieve this, also - constify two user callbacks - constify BUF_reverse. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20Handle SSL_shutdown while in init more appropriatelyMatt Caswell
Calling SSL_shutdown while in init previously gave a "1" response, meaning everything was successfully closed down (even though it wasn't). Better is to send our close_notify, but fail when trying to receive one. The problem with doing a shutdown while in the middle of a handshake is that once our close_notify is sent we shouldn't really do anything else (including process handshake/CCS messages) until we've received a close_notify back from the peer. However the peer might send a CCS before acting on our close_notify - so we won't be able to read it because we're not acting on CCS messages! Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-19Fix GOST2012-NULL-GOST12Dmitry Belyavsky
Fix a typo in the definition of the GOST2012-NULL-GOST12 ciphersuite. RT#4213 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-16Empty SNI names are not validViktor Dukhovni
While empty inputs to SSL_set1_host() clear the reference identifier list. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-07Fix declarations and constification for inline stack.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-02Protocol version selection and negotiation rewriteViktor Dukhovni
The protocol selection code is now consolidated in a few consecutive short functions in a single file and is table driven. Protocol-specific constraints that influence negotiation are moved into the flags field of the method structure. The same protocol version constraints are now applied in all code paths. It is now much easier to add new protocol versions without reworking the protocol selection logic. In the presence of "holes" in the list of enabled client protocols we no longer select client protocols below the hole based on a subset of the constraints and then fail shortly after when it is found that these don't meet the remaining constraints (suiteb, FIPS, security level, ...). Ideally, with the new min/max controls users will be less likely to create "holes" in the first place. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-01Fix no-dh.Ben Laurie
Reviewed-by: Stephen Henson <steve@openssl.org>
2015-12-24fix no-ecDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-23Server side EVP_PKEY DH supportDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-23utility functionDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-23EVP_PKEY DH client support.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-23Always generate DH keys for ephemeral DH cipher suites.Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-23Remove SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER and SSL_OP_TLS_D5_BUG support.Kurt Roeckx
Suggested by David Benjamin Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org> MR: #1520
2015-12-19Remove fixed DH ciphersuites.Dr. Stephen Henson
Remove all fixed DH ciphersuites and associated logic. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-16fix for no-ecDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-16Use EVP_PKEY for client side EC.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-16Use EVP_PKEY for server EC.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-16Add ECDH/DH utility functions.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-16Remove ECDH client auth code.Dr. Stephen Henson
Remove incomplete non-functional ECDH client authentication code. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-11Fix compile failureMatt Caswell
Fix compile failure introduced by commit 94d61512360c due to a typo. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-11Make no-dh work, plus other no-dh problems found by Richard.Ben Laurie
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-10Wire ChaCha20-Poly1305 to TLS.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-06Really disable 56-bit (single-DES) ciphersViktor Dukhovni
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-05Remove support for all 40 and 56 bit ciphers.Kurt Roeckx
Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #364
2015-12-04Remove SSL_{CTX_}set_ecdh_auto() and always enable ECDHKurt Roeckx
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-04Make SSL_{CTX}_set_tmp_ecdh() call SSL_{CTX_}set1_curves()Kurt Roeckx
SSL_{CTX}_set_tmp_ecdh() allows to set 1 EC curve and then tries to use it. On the other hand SSL_{CTX_}set1_curves() allows you to set a list of curves, but only when SSL_{CTX_}set_ecdh_auto() was called to turn it on. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-04Remove support for SSL_{CTX_}set_tmp_ecdh_callback().Kurt Roeckx
This only gets used to set a specific curve without actually checking that the peer supports it or not and can therefor result in handshake failures that can be avoided by selecting a different cipher. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-11-27Updates to GOST2012Matt Caswell
Various updates following feedback from the recent commit of the new GOST2012 code. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-11-25Remove unused cert_verify_mac codeDr. Stephen Henson
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-11-24ssl3_free(): Return if it wasn't createdPascal Cuoq
If somewhere in SSL_new() there is a memory allocation failure, ssl3_free() can get called with s->s3 still being NULL. Patch also provided by Willy Tarreau <wtarreau@haproxy.com> Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
2015-11-23Patch containing TLS implementation for GOST 2012Dmitry Belyavsky
This patch contains the necessary changes to provide GOST 2012 ciphersuites in TLS. It requires the use of an external GOST 2012 engine. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-11-19Make GOST ciphersuites require TLSv1Dr. Stephen Henson
PR#4141 Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-14Don't alow TLS v1.0 ciphersuites for SSLv3Dr. Stephen Henson
This disables some ciphersuites which aren't supported in SSL v3: specifically PSK ciphersuites which use SHA256 or SHA384 for the MAC. Thanks to the Open Crypto Audit Project for identifying this issue. Reviewed-by: Matt Caswell <matt@openssl.org>