1. 26 9月, 2016 1 次提交
    • M
      Fix Use After Free for large message sizes · 0d698f66
      Matt Caswell 提交于
      The buffer to receive messages is initialised to 16k. If a message is
      received that is larger than that then the buffer is "realloc'd". This can
      cause the location of the underlying buffer to change. Anything that is
      referring to the old location will be referring to free'd data. In the
      recent commit c1ef7c97 (master) and 4b390b6c (1.1.0) the point in the code
      where the message buffer is grown was changed. However s->init_msg was not
      updated to point at the new location.
      
      CVE-2016-6309
      Reviewed-by: NEmilia Käsper <emilia@openssl.org>
      0d698f66
  2. 22 9月, 2016 3 次提交
    • R
      Add -Wswitch-enum · f3b3d7f0
      Rich Salz 提交于
      Change code so when switching on an enumeration, have case's for all
      enumeration values.
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      f3b3d7f0
    • R
      Fix error message typo, wrong function code · a449b47c
      Richard Levitte 提交于
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      a449b47c
    • M
      Excessive allocation of memory in tls_get_message_header() · c1ef7c97
      Matt Caswell 提交于
      A TLS message includes 3 bytes for its length in the header for the message.
      This would allow for messages up to 16Mb in length. Messages of this length
      are excessive and OpenSSL includes a check to ensure that a peer is sending
      reasonably sized messages in order to avoid too much memory being consumed
      to service a connection. A flaw in the logic of version 1.1.0 means that
      memory for the message is allocated too early, prior to the excessive
      message length check. Due to way memory is allocated in OpenSSL this could
      mean an attacker could force up to 21Mb to be allocated to service a
      connection. This could lead to a Denial of Service through memory
      exhaustion. However, the excessive message length check still takes place,
      and this would cause the connection to immediately fail. Assuming that the
      application calls SSL_free() on the failed conneciton in a timely manner
      then the 21Mb of allocated memory will then be immediately freed again.
      Therefore the excessive memory allocation will be transitory in nature.
      This then means that there is only a security impact if:
      
      1) The application does not call SSL_free() in a timely manner in the
      event that the connection fails
      or
      2) The application is working in a constrained environment where there
      is very little free memory
      or
      3) The attacker initiates multiple connection attempts such that there
      are multiple connections in a state where memory has been allocated for
      the connection; SSL_free() has not yet been called; and there is
      insufficient memory to service the multiple requests.
      
      Except in the instance of (1) above any Denial Of Service is likely to
      be transitory because as soon as the connection fails the memory is
      subsequently freed again in the SSL_free() call. However there is an
      increased risk during this period of application crashes due to the lack
      of memory - which would then mean a more serious Denial of Service.
      
      This issue does not affect DTLS users.
      
      Issue was reported by Shi Lei (Gear Team, Qihoo 360 Inc.).
      
      CVE-2016-6307
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      c1ef7c97
  3. 16 9月, 2016 1 次提交
  4. 18 8月, 2016 1 次提交
  5. 20 7月, 2016 1 次提交
  6. 18 7月, 2016 1 次提交
  7. 04 6月, 2016 1 次提交
  8. 20 5月, 2016 2 次提交
    • M
      Ensure async IO works with new state machine · 1689e7e6
      Matt Caswell 提交于
      In the new state machine if using nbio and we get the header of a
      handshake message is one record with the body in the next, with an nbio
      event in the middle, then the connection was failing. This is because
      s->init_num was getting reset. We should only reset it after we have
      read the whole message.
      
      RT#4394
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      1689e7e6
    • M
      Simplify SSL BIO buffering logic · 46417569
      Matt Caswell 提交于
      The write BIO for handshake messages is bufferred so that we only write
      out to the network when we have a complete flight. There was some
      complexity in the buffering logic so that we switched buffering on and
      off at various points through out the handshake. The only real reason to
      do this was historically it complicated the state machine when you wanted
      to flush because you had to traverse through the "flush" state (in order
      to cope with NBIO). Where we knew up front that there was only going to
      be one message in the flight we switched off buffering to avoid that.
      
      In the new state machine there is no longer a need for a flush state so
      it is simpler just to have buffering on for the whole handshake. This
      also gives us the added benefit that we can simply call flush after every
      flight even if it only has one message in it. This means that BIO authors
      can implement their own buffering strategies and not have to be aware of
      the state of the SSL object (previously they would have to switch off
      their own buffering during the handshake because they could not rely on
      a flush being received when they really needed to write data out). This
      last point addresses GitHub Issue #322.
      Reviewed-by: NAndy Polyakov <appro@openssl.org>
      46417569
  9. 18 5月, 2016 1 次提交
  10. 06 2月, 2016 1 次提交
  11. 27 1月, 2016 1 次提交
    • R
      Remove /* foo.c */ comments · 34980760
      Rich 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: NViktor Dukhovni <viktor@openssl.org>
      34980760
  12. 02 1月, 2016 1 次提交
    • V
      Protocol version selection and negotiation rewrite · 4fa52141
      Viktor 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: NKurt Roeckx <kurt@openssl.org>
      4fa52141
  13. 06 11月, 2015 1 次提交
  14. 30 10月, 2015 24 次提交