1. 19 8月, 2016 1 次提交
    • M
      Fix DTLS replay protection · 1fb9fdc3
      Matt Caswell 提交于
      The DTLS implementation provides some protection against replay attacks
      in accordance with RFC6347 section 4.1.2.6.
      
      A sliding "window" of valid record sequence numbers is maintained with
      the "right" hand edge of the window set to the highest sequence number we
      have received so far. Records that arrive that are off the "left" hand
      edge of the window are rejected. Records within the window are checked
      against a list of records received so far. If we already received it then
      we also reject the new record.
      
      If we have not already received the record, or the sequence number is off
      the right hand edge of the window then we verify the MAC of the record.
      If MAC verification fails then we discard the record. Otherwise we mark
      the record as received. If the sequence number was off the right hand edge
      of the window, then we slide the window along so that the right hand edge
      is in line with the newly received sequence number.
      
      Records may arrive for future epochs, i.e. a record from after a CCS being
      sent, can arrive before the CCS does if the packets get re-ordered. As we
      have not yet received the CCS we are not yet in a position to decrypt or
      validate the MAC of those records. OpenSSL places those records on an
      unprocessed records queue. It additionally updates the window immediately,
      even though we have not yet verified the MAC. This will only occur if
      currently in a handshake/renegotiation.
      
      This could be exploited by an attacker by sending a record for the next
      epoch (which does not have to decrypt or have a valid MAC), with a very
      large sequence number. This means the right hand edge of the window is
      moved very far to the right, and all subsequent legitimate packets are
      dropped causing a denial of service.
      
      A similar effect can be achieved during the initial handshake. In this
      case there is no MAC key negotiated yet. Therefore an attacker can send a
      message for the current epoch with a very large sequence number. The code
      will process the record as normal. If the hanshake message sequence number
      (as opposed to the record sequence number that we have been talking about
      so far) is in the future then the injected message is bufferred to be
      handled later, but the window is still updated. Therefore all subsequent
      legitimate handshake records are dropped. This aspect is not considered a
      security issue because there are many ways for an attacker to disrupt the
      initial handshake and prevent it from completing successfully (e.g.
      injection of a handshake message will cause the Finished MAC to fail and
      the handshake to be aborted). This issue comes about as a result of trying
      to do replay protection, but having no integrity mechanism in place yet.
      Does it even make sense to have replay protection in epoch 0? That
      issue isn't addressed here though.
      
      This addressed an OCAP Audit issue.
      
      CVE-2016-2181
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      1fb9fdc3
  2. 17 8月, 2016 3 次提交
  3. 13 8月, 2016 1 次提交
  4. 05 8月, 2016 1 次提交
    • D
      Make DTLS1_BAD_VER work with DTLS_client_method() · 032924c4
      David Woodhouse 提交于
      DTLSv1_client_method() is deprecated, but it was the only way to obtain
      DTLS1_BAD_VER support. The SSL_OP_CISCO_ANYCONNECT hack doesn't work with
      DTLS_client_method(), and it's relatively non-trivial to make it work without
      expanding the hack into lots of places.
      
      So deprecate SSL_OP_CISCO_ANYCONNECT with DTLSv1_client_method(), and make
      it work with SSL_CTX_set_{min,max}_proto_version(DTLS1_BAD_VER) instead.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      032924c4
  5. 29 7月, 2016 1 次提交
    • M
      Simplify and rename SSL_set_rbio() and SSL_set_wbio() · 65e2d672
      Matt Caswell 提交于
      SSL_set_rbio() and SSL_set_wbio() are new functions in 1.1.0 and really
      should be called SSL_set0_rbio() and SSL_set0_wbio(). The old
      implementation was not consistent with what "set0" means though as there
      were special cases around what happens if the rbio and wbio are the same.
      We were only ever taking one reference on the BIO, and checking everywhere
      whether the rbio and wbio are the same so as not to double free.
      
      A better approach is to rename the functions to SSL_set0_rbio() and
      SSL_set0_wbio(). If an existing BIO is present it is *always* freed
      regardless of whether the rbio and wbio are the same or not. It is
      therefore the callers responsibility to ensure that a reference is taken
      for *each* usage, i.e. one for the rbio and one for the wbio.
      
      The legacy function SSL_set_bio() takes both the rbio and wbio in one go
      and sets them both. We can wrap up the old behaviour in the implementation
      of that function, i.e. previously if the rbio and wbio are the same in the
      call to this function then the caller only needed to ensure one reference
      was passed. This behaviour is retained by internally upping the ref count.
      
      This commit was inspired by BoringSSL commit f715c423224.
      
      RT#4572
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      65e2d672
  6. 25 7月, 2016 1 次提交
  7. 21 7月, 2016 1 次提交
  8. 19 7月, 2016 5 次提交
  9. 12 7月, 2016 1 次提交
    • V
      Perform DANE-EE(3) name checks by default · 5ae4ceb9
      Viktor Dukhovni 提交于
      In light of potential UKS (unknown key share) attacks on some
      applications, primarily browsers, despite RFC761, name checks are
      by default applied with DANE-EE(3) TLSA records.  Applications for
      which UKS is not a problem can optionally disable DANE-EE(3) name
      checks via the new SSL_CTX_dane_set_flags() and friends.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      5ae4ceb9
  10. 09 7月, 2016 1 次提交
  11. 08 7月, 2016 1 次提交
  12. 01 7月, 2016 1 次提交
  13. 30 6月, 2016 1 次提交
  14. 23 6月, 2016 1 次提交
  15. 22 6月, 2016 1 次提交
  16. 08 6月, 2016 2 次提交
  17. 05 6月, 2016 1 次提交
  18. 04 6月, 2016 2 次提交
  19. 01 6月, 2016 1 次提交
  20. 24 5月, 2016 1 次提交
  21. 18 5月, 2016 1 次提交
  22. 16 5月, 2016 2 次提交
  23. 06 5月, 2016 1 次提交
    • M
      Handle no async jobs in libssl · fc7f190c
      Matt Caswell 提交于
      If the application has limited the size of the async pool using
      ASYNC_init_thread() then we could run out of jobs while trying to start a
      libssl io operation. However libssl was failing to handle this and treating
      it like a fatal error. It should not be fatal...we just need to retry when
      there are jobs available again.
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      fc7f190c
  24. 29 4月, 2016 1 次提交
  25. 22 4月, 2016 1 次提交
  26. 14 4月, 2016 1 次提交
  27. 13 4月, 2016 2 次提交
  28. 11 4月, 2016 1 次提交
  29. 08 4月, 2016 2 次提交