1. 19 Aug, 2016 13 commits
    • Rich Salz's avatar
      RT3940: For now, just document the issue. · ff5537c2
      Rich Salz authored
      
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      (cherry picked from commit 2a9afa40)
      ff5537c2
    • Rich Salz's avatar
      Fix NULL-return checks in 1.0.2 · a03f81f4
      Rich Salz authored
      
      
      RT4386: Add sanity checks for BN_new()
      RT4384: Missing Sanity Checks for RSA_new_method()
      RT4384: Missing Sanity Check plus potential NULL pointer deref
      RT4382: Missing Sanity Check(s) for BUF_strdup()
      RT4380: Missing Sanity Checks for EVP_PKEY_new()
      RT4377: Prevent potential NULL pointer dereference
      RT4375: Missing sanity checks for OPENSSL_malloc()
      RT4374: Potential for NULL pointer dereferences
      RT4371: Missing Sanity Check for malloc()
      RT4370: Potential for NULL pointer dereferences
      
      Also expand tabs, make update, typo fix (rsalz)
      Minor tweak by Paul Dale.
      Some minor internal review feedback.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      a03f81f4
    • Richard Levitte's avatar
      Have dtlstest run on VMS as well · 66e70832
      Richard Levitte authored
      
      
      Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
      66e70832
    • Matt Caswell's avatar
      Update function error code · 26aebca7
      Matt Caswell authored
      
      
      A function error code needed updating due to merge issues.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      26aebca7
    • Matt Caswell's avatar
      Fix DTLS replay protection · 3884b47b
      Matt Caswell authored
      
      
      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: default avatarRichard Levitte <levitte@openssl.org>
      3884b47b
    • Matt Caswell's avatar
      Add DTLS replay protection test · 30ea36e6
      Matt Caswell authored
      
      
      Injects a record from epoch 1 during epoch 0 handshake, with a record
      sequence number in the future, to test that the record replay protection
      feature works as expected. This is described more fully in the next commit.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      30ea36e6
    • Matt Caswell's avatar
      Fix DTLS unprocessed records bug · 20744f6b
      Matt Caswell authored
      
      
      During a DTLS handshake we may get records destined for the next epoch
      arrive before we have processed the CCS. In that case we can't decrypt or
      verify the record yet, so we buffer it for later use. When we do receive
      the CCS we work through the queue of unprocessed records and process them.
      
      Unfortunately the act of processing wipes out any existing packet data
      that we were still working through. This includes any records from the new
      epoch that were in the same packet as the CCS. We should only process the
      buffered records if we've not got any data left.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      20744f6b
    • Matt Caswell's avatar
      Add a DTLS unprocesed records test · bc4d7e12
      Matt Caswell authored
      
      
      Add a test to inject a record from the next epoch during the handshake and
      make sure it doesn't get processed immediately.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      bc4d7e12
    • Matt Caswell's avatar
      Back port ssltestlib code to 1.0.2 · 48e8df6e
      Matt Caswell authored
      
      
      Enables the testing of DTLS code in 1.0.2
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      48e8df6e
    • Richard Levitte's avatar
      VSI submission: RAND fixups · 7b415b0e
      Richard Levitte authored
      
      
      - make the VMS version of RAND_poll() faster and more secure
      - avoid pointer size warnings with setvbuf()
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      7b415b0e
    • Richard Levitte's avatar
    • Richard Levitte's avatar
      556c4b51
    • Richard Levitte's avatar
  2. 18 Aug, 2016 1 commit
  3. 16 Aug, 2016 1 commit
  4. 15 Aug, 2016 3 commits
  5. 11 Aug, 2016 1 commit
  6. 05 Aug, 2016 2 commits
  7. 04 Aug, 2016 4 commits
  8. 03 Aug, 2016 1 commit
  9. 02 Aug, 2016 4 commits
  10. 29 Jul, 2016 1 commit
  11. 28 Jul, 2016 1 commit
  12. 26 Jul, 2016 2 commits
  13. 22 Jul, 2016 4 commits
  14. 20 Jul, 2016 1 commit
  15. 19 Jul, 2016 1 commit