summaryrefslogtreecommitdiffstats
path: root/ssl/s3_both.c
AgeCommit message (Collapse)Author
2015-05-16Updates following review commentsMatt Caswell
Miscellaneous updates following review comments on the version negotiation rewrite patches. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Server side version negotiation rewriteMatt Caswell
This commit changes the way that we do server side protocol version negotiation. Previously we had a whole set of code that had an "up front" state machine dedicated to the negotiating the protocol version. This adds significant complexity to the state machine. Historically the justification for doing this was the support of SSLv2 which works quite differently to SSLv3+. However, we have now removed support for SSLv2 so there is little reason to maintain this complexity. The one slight difficulty is that, although we no longer support SSLv2, we do still support an SSLv3+ ClientHello in an SSLv2 backward compatible ClientHello format. This is generally only used by legacy clients. This commit adds support within the SSLv3 code for these legacy format ClientHellos. Server side version negotiation now works in much the same was as DTLS, i.e. we introduce the concept of TLS_ANY_VERSION. If s->version is set to that then when a ClientHello is received it will work out the most appropriate version to respond with. Also, SSLv23_method and SSLv23_server_method have been replaced with TLS_method and TLS_server_method respectively. The old SSLv23* names still exist as macros pointing at the new name, although they are deprecated. Subsequent commits will look at client side version negotiation, as well of removal of the old s23* code. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-04-30Sanity check the return from final_finish_macMatt Caswell
The return value is checked for 0. This is currently safe but we should really check for <= 0 since -1 is frequently used for error conditions. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-26Move read_sequence and write_sequence from s->s3 to s->rlayerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move SSL3_BUFFER set up and release code into ssl3_buffer.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate access to s->s3->wbufMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate SSL3_BUFFER and all access to s->s3->rbuf.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23ssl3_set_handshake_header returnsMatt Caswell
Change ssl_set_handshake_header from return void to returning int, and handle error return code appropriately. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-27OPENSSL_NO_XXX cleanup: OPENSSL_NO_BUF_FREELISTSRich Salz
Remove OPENSSL_NO_BUF_FREELISTS. This was turned on by default, so the work here is removing the 'maintain our own freelist' code. Also removed a minor old Windows-multibyte/widechar conversion flag. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt 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. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12RT3548: Remove unsupported platformsRich Salz
This last one for this ticket. Removes WIN16. So long, MS_CALLBACK and MS_FAR. We won't miss you. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-06Further comment amendments to preserve formatting prior to source reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-02Remove MS SGCDr. Stephen Henson
MS Server gated cryptography is obsolete and dates from the time of export restrictions on strong encryption and is only used by ancient versions of MSIE. Reviewed-by: Matt Caswell <matt@openssl.org>
2014-12-30mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-11-28[PR3597] Advance to the next state variant when reusing messages.Richard Levitte
Previously, state variant was not advanced, which resulted in state being stuck in the st1 variant (usually "_A"). This broke certificate callback retry logic when accepting connections that were using SSLv2 ClientHello (hence reusing the message), because their state never advanced to SSL3_ST_SR_CLNT_HELLO_C variant required for the retry code path. Reported by Yichun Zhang (agentzh). Signed-off-by: Piotr Sikora <piotr@cloudflare.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-03-28Security framework.Dr. Stephen Henson
Security callback: selects which parameters are permitted including sensible defaults based on bits of security. The "parameters" which can be selected include: ciphersuites, curves, key sizes, certificate signature algorithms, supported signature algorithms, DH parameters, SSL/TLS version, session tickets and compression. In some cases prohibiting the use of a parameters will mean they are not advertised to the peer: for example cipher suites and ECC curves. In other cases it will abort the handshake: e.g DH parameters or the peer key size. Documentation to follow...
2014-01-07Add fix for CVE-2013-4353Dr. Stephen Henson
(cherry picked from commit 6b42ed4e7104898f4b5b69337589719913b36404)
2013-12-18Check EVP errors for handshake digests.Dr. Stephen Henson
Partial mitigation of PR#3200 (cherry picked from commit 0294b2be5f4c11e60620c0018674ff0e17b14238)
2013-03-18DTLS revision.Dr. Stephen Henson
Revise DTLS code. There was a *lot* of code duplication in the DTLS code that generates records. This makes it harder to maintain and sometimes a TLS update is omitted by accident from the DTLS code. Specifically almost all of the record generation functions have code like this: some_pointer = buffer + HANDSHAKE_HEADER_LENGTH; ... Record creation stuff ... set_handshake_header(ssl, SSL_MT_SOMETHING, message_len); ... write_handshake_message(ssl); Where the "Record creation stuff" is identical between SSL/TLS and DTLS or in some cases has very minor differences. By adding a few fields to SSL3_ENC to include the header length, some flags and function pointers for handshake header setting and handshake writing the code can cope with both cases. Note: although this passes "make test" and some simple DTLS tests there may be some minor differences in the DTLS code that have to be accounted for.
2013-02-06Add and use a constant-time memcmp.Ben Laurie
This change adds CRYPTO_memcmp, which compares two vectors of bytes in an amount of time that's independent of their contents. It also changes several MAC compares in the code to use this over the standard memcmp, which may leak information about the size of a matching prefix. (cherry picked from commit 2ee798880a246d648ecddadc5b91367bee4a5d98)
2012-04-18recognise X9.42 DH certificates on serversDr. Stephen Henson
2012-01-26Revise ssl code to use a CERT_PKEY structure when outputting aDr. Stephen Henson
certificate chain instead of an X509 structure. This makes it easier to enhance code in future and the chain output functions have access to the CERT_PKEY structure being used.
2012-01-26Tidy/enhance certificate chain output code.Dr. Stephen Henson
New function ssl_add_cert_chain which adds a certificate chain to SSL internal BUF_MEM. Use this function in ssl3_output_cert_chain and dtls1_output_cert_chain instead of partly duplicating code.
2012-01-16Support for fixed DH ciphersuites.Dr. Stephen Henson
The cipher definitions of these ciphersuites have been around since SSLeay but were always disabled. Now OpenSSL supports DH certificates they can be finally enabled. Various additional changes were needed to make them work properly: many unused fixed DH sections of code were untested.
2010-09-05Fixes to NPN from Adam Langley.Ben Laurie
2010-07-28Add Next Protocol Negotiation.Ben Laurie
2010-03-24PR: 1731 and maybe 2197Dr. Stephen Henson
Clear error queue in a few places in SSL code where errors are expected so they don't stay in the queue.
2009-11-09First cut of renegotiation extension. (port to HEAD)Dr. Stephen Henson
2009-09-02PR: 2022Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org Fix DTLS record header length bug.
2009-07-15Update from 1.0.0-stable.Dr. Stephen Henson
2009-06-28Update from 0.9.8-stable.Dr. Stephen Henson
2008-08-05Fix signed/unsigned warning.Geoff Thorpe
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-03Memory saving patch.Ben Laurie
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>
2006-10-20Align data payload for better performance.Andy Polyakov
2005-10-08New option SSL_OP_NO_COMP to disable compression. New ctrls to setDr. Stephen Henson
maximum send fragment size. Allocate I/O buffers accordingly.
2005-04-26Add DTLS support.Ben Laurie
2005-04-07get rid of very buggy and very imcomplete DH cert supportNils Larsch
Reviewed by: Bodo Moeller
2003-02-12Option to disable SSL auto chain buildDr. Stephen Henson
2002-11-13Security fixes brought forward from 0.9.7.Ben Laurie
2002-08-12remove commentBodo Möller
Submitted by: Douglas Stebila
2002-08-12get rid of EVP_PKEY_ECDSA (now we have EVP_PKEY_EC instead)Bodo Möller
Submitted by: Nils Larsch
2002-08-09ECC ciphersuite supportBodo Möller
Submitted by: Douglas Stebila <douglas.stebila@sun.com> (Authors: Vipul Gupta and Sumit Gupta, Sun Microsystems Laboratories)
2002-07-10Reorder inclusion of header files:Lutz Jänicke
des_old.h redefines crypt: #define crypt(b,s)\ DES_crypt((b),(s)) This scheme leads to failure, if header files with the OS's true definition of crypt() are processed _after_ des_old.h was processed. This is e.g. the case on HP-UX with unistd.h. As evp.h now again includes des.h (which includes des_old.h), this problem only came up after this modification. Solution: move header files (indirectly) including e_os.h before the header files (indirectly) including evp.h. Submitted by: Reviewed by: PR:
2002-04-13Implement known-IV countermeasure.Bodo Möller
Fix length checks in ssl3_get_client_hello(). Use s->s3->in_read_app_data differently to fix ssl3_read_internal().
2002-03-19Map new X509 verification errors to alert codes (Tom Wu <tom@arcot.com>).Lutz Jänicke
2001-10-20Call msg_callback with correct length parameter if ssl3_write_bytes had toBodo Möller
be called multiple times