summaryrefslogtreecommitdiffstats
path: root/ssl/d1_both.c
AgeCommit message (Collapse)Author
2015-01-22Re-align some comments after running the reformat script.OpenSSL_0_9_8-post-reformatMatt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) This commit is for the 0.9.8 changes Reviewed-by: Tim Hudson <tjh@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. 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 Conflicts: crypto/ec/ecp_nistp224.c crypto/evp/evp.h ssl/d1_both.c ssl/ssl.h ssl/ssl_lib.c Conflicts: crypto/bio/bss_file.c crypto/ec/ec_lcl.h crypto/evp/evp.h crypto/store/str_mem.c crypto/whrlpool/wp_block.c crypto/x509/x509_vfy.h ssl/ssl.h ssl/ssl3.h ssl/ssltest.c ssl/t1_lib.c ssl/tls1.h 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 Conflicts: crypto/asn1/a_sign.c crypto/bn/bn_div.c crypto/dsa/dsa_asn1.c crypto/ec/ecp_nistp224.c crypto/ec/ecp_nistp256.c crypto/ec/ecp_nistp521.c crypto/ec/ecp_nistputil.c crypto/modes/gcm128.c crypto/opensslv.h ssl/d1_both.c ssl/heartbeat_test.c ssl/s3_clnt.c ssl/s3_srvr.c ssl/ssl_sess.c ssl/t1_lib.c test/testutil.h Conflicts: apps/openssl.c apps/ts.c apps/vms_decc_init.c crypto/aes/aes_core.c crypto/aes/aes_x86core.c crypto/dsa/dsa_ameth.c crypto/ec/ec2_mult.c crypto/evp/evp.h crypto/objects/objects.h crypto/rsa/rsa_pss.c crypto/stack/safestack.h crypto/ts/ts.h crypto/ts/ts_rsp_verify.c crypto/whrlpool/wp_dgst.c crypto/x509v3/v3_ncons.c e_os2.h engines/ccgost/gost89.c engines/ccgost/gost_ctl.c engines/ccgost/gost_keywrap.c engines/ccgost/gost_keywrap.h engines/ccgost/gost_sign.c ssl/kssl.c ssl/s3_srvr.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-08-06Remove some duplicate DTLS code.Adam Langley
In |dtls1_process_out_of_seq_message|, we know that |frag_len| <= |msg_hdr->msg_len| so the later tests for |frag_len < msg_hdr->msg_len| can be more clearly written as |frag_len != msg_hdr->msg_len|, since that's the only remaining case. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Applying same fix as in dtls1_process_out_of_seq_message. A truncated DTLS ↵Matt Caswell
fragment would cause *ok to be clear, but the return value would still be the number of bytes read. Problem identified by Emilia Käsper, based on previous issue/patch by Adam Langley. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Fix return code for truncated DTLS fragment.Adam Langley
Previously, a truncated DTLS fragment in |dtls1_process_out_of_seq_message| would cause *ok to be cleared, but the return value would still be the number of bytes read. This would cause |dtls1_get_message| not to consider it an error and it would continue processing as normal until the calling function noticed that *ok was zero. I can't see an exploit here because |dtls1_get_message| uses |s->init_num| as the length, which will always be zero from what I can see. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Fix memory leak from zero-length DTLS fragments.Adam Langley
The |pqueue_insert| function can fail if one attempts to insert a duplicate sequence number. When handling a fragment of an out of sequence message, |dtls1_process_out_of_seq_message| would not call |dtls1_reassemble_fragment| if the fragment's length was zero. It would then allocate a fresh fragment and attempt to insert it, but ignore the return value, leaking the fragment. This allows an attacker to exhaust the memory of a DTLS peer. Fixes CVE-2014-3507 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Fix DTLS handshake message size checks.Matt Caswell
In |dtls1_reassemble_fragment|, the value of |msg_hdr->frag_off+frag_len| was being checked against the maximum handshake message size, but then |msg_len| bytes were allocated for the fragment buffer. This means that so long as the fragment was within the allowed size, the pending handshake message could consume 16MB + 2MB (for the reassembly bitmap). Approx 10 outstanding handshake messages are allowed, meaning that an attacker could consume ~180MB per DTLS connection. In the non-fragmented path (in |dtls1_process_out_of_seq_message|), no check was applied. Fixes CVE-2014-3506 Wholly based on patch by Adam Langley with one minor amendment. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Added comment for the frag->reassembly == NULL case as per feedback from EmiliaMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-08-06Avoid double free when processing DTLS packets.Adam Langley
The |item| variable, in both of these cases, may contain a pointer to a |pitem| structure within |s->d1->buffered_messages|. It was being freed in the error case while still being in |buffered_messages|. When the error later caused the |SSL*| to be destroyed, the item would be double freed. Thanks to Wah-Teh Chang for spotting that the fix in 1632ef74 was inconsistent with the other error paths (but correct). Fixes CVE-2014-3505 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-06-10Fix null pointer errors.Dr. Stephen Henson
PR#3394 (cherry picked from commit 7a9d59c148b773f59a41f8697eeecf369a0974c2)
2014-06-03Fix CVE-2014-0221Dr. Stephen Henson
Unnecessary recursion when receiving a DTLS hello request can be used to crash a DTLS client. Fixed by handling DTLS hello request without recursion. Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
2014-06-03Fix for CVE-2014-0195Dr. Stephen Henson
A buffer overrun attack can be triggered by sending invalid DTLS fragments to an OpenSSL DTLS client or server. This is potentially exploitable to run arbitrary code on a vulnerable client or server. Fixed by adding consistency check for DTLS fragments. Thanks to Jüri Aedla for reporting this issue.
2014-06-02Typo: set i to -1 before goto.Sami Farin
PR#3302 (cherry picked from commit 9717f01951f976f76dd40a38d9fc7307057fa4c4)
2013-03-18Avoid unnecessary fragmentation.Michael Tuexen
(cherry picked from commit 80ccc66d7eedb2d06050130c77c482ae1584199a)
2012-03-07PR: 2755Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reduce MTU after failed transmissions. [0.9.8 version of patch]
2012-03-06revert PR#2755: it breaks compilationDr. Stephen Henson
2012-03-06PR: 2755Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reduce MTU after failed transmissions.
2011-10-27PR: 2628Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Send alert instead of assertion failure for incorrectly formatted DTLS fragments.
2011-09-23PR: 2602Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Fix DTLS bug which prevents manual MTU setting
2011-04-03PR: 2462Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Fix DTLS Retransmission Buffer Bug
2011-04-03PR: 2458Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Don't change state when answering DTLS ClientHello.
2011-04-03PR: 2457Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Fix DTLS fragment reassembly bug.
2010-05-03PR: 2230Dr. Stephen Henson
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de> Fix bug in bitmask macros and stop warnings.
2010-04-14PR: 2230Dr. Stephen Henson
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de> Fixed various DTLS fragment reassembly bugs patch for 0.9.8.
2010-04-14fix signed/unsigned comparison warningsDr. Stephen Henson
2010-04-14PR: 2230Dr. Stephen Henson
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de> Fix various DTLS fragment reassembly bugs.
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.
2010-01-26Fix VC++ warning (change had already been made to other branches).Dr. Stephen Henson
2009-12-01PR: 2115Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org Add Renegotiation extension to DTLS, fix DTLS ClientHello processing bug.
2009-11-04PR: 2089Dr. Stephen Henson
Submitted by: David Woodhouse <dwmw2@infradead.org> Approved by: steve@openssl.org Use EVP_MD_size() in OpenSSL 0.9.8.
2009-11-02PR: 2089Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org DTLS Fragment size bug fix.
2009-10-01PR: 2054Dr. Stephen Henson
Submitted by: Julia Lawall <julia@diku.dk> Approved by: steve@openssl.org Correct BIO_ctrl error handling
2009-08-13PR: 1997Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org DTLS timeout handling fix.
2009-08-06Fix error codes.Dr. Stephen Henson
2009-06-28PR: 1942Dr. Stephen Henson
Submitted by: David Woodhouse <dwmw2@infradead.org> Approved by: steve@openssl.org Replace ad-hoc chain builder with X509_verify_cert().
2009-06-05Update from 1.0.0-stable.Dr. Stephen Henson
2009-05-180.9.8 version of PR#1931 fix.Dr. Stephen Henson
2009-05-18Fix from 1.0.0-stable branch.Dr. Stephen Henson
2009-05-17Reverted fix to PR#1931.. breaks compilation in 0.9.8.Dr. Stephen Henson
2009-05-16Fix from 1.0.0-stable.Dr. Stephen Henson
2009-05-16Updates from 1.0.0-stable.Dr. Stephen Henson
2009-05-13Update from 1.0.0-stable.Dr. Stephen Henson
2009-04-02PR: 1828Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org Fix DTLS retransmission bug.
2009-04-02PR: 1838Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Approved by: steve@openssl.org DTLS fragment bug.
2007-10-17Don't let DTLS ChangeCipherSpec increment handshake sequence number. FromAndy Polyakov
HEAD with a twist: server interoperates with non-compliant client. PR: 1587
2007-10-12Avoid shadow and signed/unsigned warnings.Dr. Stephen Henson
2007-10-11make update, and more DTLS stuff.Ben Laurie
2007-09-30Make ChangeCipherSpec compliant with DTLS RFC4347. From HEAD with a twist:Andy Polyakov
server interoperates with non-compliant pre-0.9.8f.