1. 30 10月, 2015 4 次提交
  2. 23 9月, 2015 2 次提交
    • M
      Remove remaining old listen code · 912c89c5
      Matt Caswell 提交于
      The old implementation of DTLSv1_listen which has now been replaced still
      had a few vestiges scattered throughout the code. This commit removes them.
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      912c89c5
    • M
      DTLSv1_listen rewrite · e3d0dae7
      Matt Caswell 提交于
      The existing implementation of DTLSv1_listen() is fundamentally flawed. This
      function is used in DTLS solutions to listen for new incoming connections
      from DTLS clients. A client will send an initial ClientHello. The server
      will respond with a HelloVerifyRequest containing a unique cookie. The
      client the responds with a second ClientHello - which this time contains the
      cookie.
      
      Once the cookie has been verified then DTLSv1_listen() returns to user code,
      which is typically expected to continue the handshake with a call to (for
      example) SSL_accept().
      
      Whilst listening for incoming ClientHellos, the underlying BIO is usually in
      an unconnected state. Therefore ClientHellos can come in from *any* peer.
      The arrival of the first ClientHello without the cookie, and the second one
      with it, could be interspersed with other intervening messages from
      different clients.
      
      The whole purpose of this mechanism is as a defence against DoS attacks. The
      idea is to avoid allocating state on the server until the client has
      verified that it is capable of receiving messages at the address it claims
      to come from. However the existing DTLSv1_listen() implementation completely
      fails to do this. It attempts to super-impose itself on the standard state
      machine and reuses all of this code. However the standard state machine
      expects to operate in a stateful manner with a single client, and this can
      cause various problems.
      
      A second more minor issue is that the return codes from this function are
      quite confused, with no distinction made between fatal and non-fatal errors.
      Most user code treats all errors as non-fatal, and simply retries the call
      to DTLSv1_listen().
      
      This commit completely rewrites the implementation of DTLSv1_listen() and
      provides a stand alone implementation that does not rely on the existing
      state machine. It also provides more consistent return codes.
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      e3d0dae7
  3. 14 8月, 2015 1 次提交
  4. 03 8月, 2015 2 次提交
    • M
      Move DTLS CCS processing into the state machine · c69f2adf
      Matt Caswell 提交于
      Continuing on from the previous commit this moves the processing of DTLS
      CCS messages out of the record layer and into the state machine.
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      c69f2adf
    • M
      Move TLS CCS processing into the state machine · 657da85e
      Matt Caswell 提交于
      The handling of incoming CCS records is a little strange. Since CCS is not
      a handshake message it is handled differently to normal handshake messages.
      Unfortunately whilst technically it is not a handhshake message the reality
      is that it must be processed in accordance with the state of the handshake.
      Currently CCS records are processed entirely within the record layer. In
      order to ensure that it is handled in accordance with the handshake state
      a flag is used to indicate that it is an acceptable time to receive a CCS.
      
      Previously this flag did not exist (see CVE-2014-0224), but the flag should
      only really be considered a workaround for the problem that CCS is not
      visible to the state machine.
      
      Outgoing CCS messages are already handled within the state machine.
      
      This patch makes CCS visible to the TLS state machine. A separate commit
      will handle DTLS.
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      657da85e
  5. 29 5月, 2015 1 次提交
  6. 22 5月, 2015 1 次提交
  7. 06 5月, 2015 1 次提交
  8. 05 5月, 2015 1 次提交
    • R
      Use safer sizeof variant in malloc · b4faea50
      Rich Salz 提交于
      For a local variable:
              TYPE *p;
      Allocations like this are "risky":
              p = OPENSSL_malloc(sizeof(TYPE));
      if the type of p changes, and the malloc call isn't updated, you
      could get memory corruption.  Instead do this:
              p = OPENSSL_malloc(sizeof(*p));
      Also fixed a few memset() calls that I noticed while doing this.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      b4faea50
  9. 02 5月, 2015 1 次提交
    • R
      free NULL cleanup -- coda · 25aaa98a
      Rich Salz 提交于
      After the finale, the "real" final part. :)  Do a recursive grep with
      "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are
      an "if NULL" check that can be removed.
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      25aaa98a
  10. 01 5月, 2015 1 次提交
  11. 17 4月, 2015 1 次提交
  12. 31 3月, 2015 1 次提交
  13. 27 3月, 2015 1 次提交
  14. 26 3月, 2015 22 次提交