1. 02 Jun, 2015 1 commit
    • Matt Caswell's avatar
      Clear state in DTLSv1_listen · cce3e4ad
      Matt Caswell authored
      This is a backport of commit e83ee04b
      
       from
      the master branch (and this has also been applied to 1.0.2). In 1.0.2 this
      was CVE-2015-0207. For other branches there is no known security issue, but
      this is being backported as a precautionary measure.
      
      The DTLSv1_listen function is intended to be stateless and processes
      the initial ClientHello from many peers. It is common for user code to
      loop over the call to DTLSv1_listen until a valid ClientHello is received
      with an associated cookie. A defect in the implementation of DTLSv1_listen
      means that state is preserved in the SSL object from one invokation to the
      next.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      cce3e4ad
  2. 31 May, 2015 1 commit
    • Matt Caswell's avatar
      Check the message type requested is the type received in DTLS · f3e85f43
      Matt Caswell authored
      
      
      dtls1_get_message has an |mt| variable which is the type of the message that
      is being requested. If it is negative then any message type is allowed.
      However the value of |mt| is not checked in one of the main code paths, so a
      peer can send a message of a completely different type and it will be
      processed as if it was the message type that we were expecting. This has
      very little practical consequences because the current behaviour will still
      fail when the format of the message isn't as expected.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      (cherry picked from commit 8c2b1d87)
      f3e85f43
  3. 28 May, 2015 2 commits
  4. 26 May, 2015 9 commits
  5. 25 May, 2015 1 commit
  6. 23 May, 2015 3 commits
  7. 22 May, 2015 3 commits
    • Matt Caswell's avatar
      Fix off-by-one in BN_rand · b484b040
      Matt Caswell authored
      
      
      If BN_rand is called with |bits| set to 1 and |top| set to 1 then a 1 byte
      buffer overflow can occur. There are no such instances within the OpenSSL at
      the moment.
      
      Thanks to Mateusz Kocielski (LogicalTrust), Marek Kroemeke, Filip Palian for
      discovering and reporting this issue.
      
      Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
      b484b040
    • Matt Caswell's avatar
      Reject negative shifts for BN_rshift and BN_lshift · 726b5e71
      Matt Caswell authored
      
      
      The functions BN_rshift and BN_lshift shift their arguments to the right or
      left by a specified number of bits. Unpredicatable results (including
      crashes) can occur if a negative number is supplied for the shift value.
      
      Thanks to Mateusz Kocielski (LogicalTrust), Marek Kroemeke and Filip Palian
      for discovering and reporting this issue.
      
      Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
      (cherry picked from commit 7cc18d81)
      
      Conflicts:
      	crypto/bn/bn.h
      	crypto/bn/bn_err.c
      726b5e71
    • Lubom's avatar
      Lost alert in DTLS · 0a9f8e06
      Lubom authored
      
      
      If a client receives a bad hello request in DTLS then the alert is not
      sent correctly.
      
      RT#2801
      
      Signed-off-by: default avatarMatt Caswell <matt@openssl.org>
      Reviewed-by: default avatarKurt Roeckx <kurt@openssl.org>
      (cherry picked from commit 4dc1aa04)
      0a9f8e06
  8. 20 May, 2015 11 commits
  9. 19 May, 2015 1 commit
  10. 15 May, 2015 1 commit
  11. 13 May, 2015 3 commits
    • Rich Salz's avatar
      Add NULL checks from master · 76b49a8a
      Rich Salz authored
      
      
      The big "don't check for NULL" cleanup requires backporting some
      of the lowest-level functions to actually do nothing if NULL is
      given.  This will make it easier to backport fixes to release
      branches, where master assumes those lower-level functions are "safe"
      
      This commit addresses those tickets: 3798 3799 3801.
      
      Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
      (cherry picked from commit f34b095f)
      76b49a8a
    • Hanno Böck's avatar
      Call of memcmp with null pointers in obj_cmp() · 5e0ec901
      Hanno Böck authored
      
      
      The function obj_cmp() (file crypto/objects/obj_dat.c) can in some
      situations call memcmp() with a null pointer and a zero length.
      
      This is invalid behaviour. When compiling openssl with undefined
      behaviour sanitizer (add -fsanitize=undefined to compile flags) this
      can be seen. One example that triggers this behaviour is the pkcs7
      command (but there are others, e.g. I've seen it with the timestamp
      function):
      apps/openssl pkcs7 -in test/testp7.pem
      
      What happens is that obj_cmp takes objects of the type ASN1_OBJECT and
      passes their ->data pointer to memcmp. Zero-sized ASN1_OBJECT
      structures can have a null pointer as data.
      
      RT#3816
      
      Signed-off-by: default avatarMatt Caswell <matt@openssl.org>
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      (cherry picked from commit 2b8dc08b)
      5e0ec901
    • Matt Caswell's avatar
      Don't allow a CCS when expecting a CertificateVerify · 5c122908
      Matt Caswell authored
      
      
      Currently we set change_cipher_spec_ok to 1 before calling
      ssl3_get_cert_verify(). This is because this message is optional and if it
      is not sent then the next thing we would expect to get is the CCS. However,
      although it is optional, we do actually know whether we should be receiving
      one in advance. If we have received a client cert then we should expect
      a CertificateVerify message. By the time we get to this point we will
      already have bombed out if we didn't get a Certificate when we should have
      done, so it is safe just to check whether |peer| is NULL or not. If it is
      we won't get a CertificateVerify, otherwise we will. Therefore we should
      change the logic so that we only attempt to get the CertificateVerify if
      we are expecting one, and not allow a CCS in this scenario.
      
      Whilst this is good practice for TLS it is even more important for DTLS.
      In DTLS messages can be lost. Therefore we may be in a situation where a
      CertificateVerify message does not arrive even though one was sent. In that
      case the next message the server will receive will be the CCS. This could
      also happen if messages get re-ordered in-flight. In DTLS if
      |change_cipher_spec_ok| is not set and a CCS is received it is ignored.
      However if |change_cipher_spec_ok| *is* set then a CCS arrival will
      immediately move the server into the next epoch. Any messages arriving for
      the previous epoch will be ignored. This means that, in this scenario, the
      handshake can never complete. The client will attempt to retransmit
      missing messages, but the server will ignore them because they are the wrong
      epoch. The server meanwhile will still be waiting for the CertificateVerify
      which is never going to arrive.
      
      RT#2958
      
      Reviewed-by: default avatarEmilia Käsper <emilia@openssl.org>
      (cherry picked from commit a0bd6493)
      5c122908
  12. 11 May, 2015 3 commits
  13. 05 May, 2015 1 commit