1. 29 Jul, 2016 6 commits
    • Matt Caswell's avatar
      Add some SSL BIO tests · 9a716987
      Matt Caswell authored
      
      
      This adds some simple SSL BIO tests that check for pushing and popping of
      BIOs into the chain. These tests would have caught the bugs fixed in the
      previous three commits, if combined with a crypto-mdebug build.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      9a716987
    • Matt Caswell's avatar
      Fix BIO_pop for SSL BIOs · b46fe860
      Matt Caswell authored
      
      
      The BIO_pop implementation assumes that the rbio still equals the next BIO
      in the chain. While this would normally be the case, it is possible that it
      could have been changed directly by the application. It also does not
      properly cater for the scenario where the buffering BIO is still in place
      for the write BIO.
      
      Most of the existing BIO_pop code for SSL BIOs can be replaced by a single
      call to SSL_set_bio(). This is equivalent to the existing code but
      additionally handles the scenario where the rbio has been changed or the
      buffering BIO is still in place.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      b46fe860
    • Matt Caswell's avatar
      Fix BIO_push ref counting for SSL BIO · eddef305
      Matt Caswell authored
      
      
      When pushing a BIO onto an SSL BIO we set the rbio and wbio for the SSL
      object to be the BIO that has been pushed. Therefore we need to up the ref
      count for that BIO. The existing code was uping the ref count on the wrong
      BIO.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      eddef305
    • Matt Caswell's avatar
      Don't double free the write bio · 8e3854ac
      Matt Caswell authored
      
      
      When setting the read bio we free up any old existing one. However this can
      lead to a double free if the existing one is the same as the write bio.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      8e3854ac
    • Matt Caswell's avatar
      Add a test for SSL_set_bio() · 7fb4c820
      Matt Caswell authored
      
      
      The SSL_set_bio() function has some complicated ownership rules. This adds a
      test to make sure it all works as expected.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      7fb4c820
    • Matt Caswell's avatar
      Make the checks for an SSLv2 style record stricter · 0647719d
      Matt Caswell authored
      
      
      SSLv2 is no longer supported in 1.1.0, however we *do* still accept an SSLv2
      style ClientHello, as long as we then subsequently negotiate a protocol
      version >= SSLv3. The record format for SSLv2 style ClientHellos is quite
      different to SSLv3+. We only accept this format in the first record of an
      initial ClientHello. Previously we checked this by confirming
      s->first_packet is set and s->server is true. However, this really only
      tells us that we are dealing with an initial ClientHello, not that it is
      the first record (s->first_packet is badly named...it really means this is
      the first message). To check this is the first record of the initial
      ClientHello we should also check that we've not received any data yet
      (s->init_num == 0), and that we've not had any empty records.
      
      GitHub Issue #1298
      
      Reviewed-by: default avatarEmilia Käsper <emilia@openssl.org>
      0647719d
  2. 28 Jul, 2016 2 commits
  3. 26 Jul, 2016 11 commits
  4. 25 Jul, 2016 21 commits