1. 24 2月, 2017 7 次提交
    • B
      Add SSL_CTX early callback · 6b1bb98f
      Benjamin Kaduk 提交于
      Provide a callback interface that gives the application the ability
      to adjust the nascent SSL object at the earliest stage of ClientHello
      processing, immediately after extensions have been collected but
      before they have been processed.
      
      This is akin to BoringSSL's "select_certificate_cb" (though it is not
      API compatible), and as the name indicates, one major use is to examine
      the supplied server name indication and select what certificate to
      present to the client.  However, it can also be used to make more
      sweeping configuration changes to the SSL object according to the
      selected server identity and configuration.  That may include adjusting
      the permitted TLS versions, swapping out the SSL_CTX object (as is
      traditionally done in a tlsext_servername_callback), changing the
      server's cipher list, and more.
      
      We also wish to allow an early callback to indicate that it needs to perform
      additional work asynchronously and resume processing later.  To that effect,
      refactor the second half of tls_process_client_hello() into a subroutine to be
      called at the post-processing stage (including the early callback itself), to
      allow the callback to result in remaining in the same work stage for a later
      call to succeed.  This requires allocating for and storing the CLIENTHELLO_MSG
      in the SSL object to be preserved across such calls, but the storage is
      reclaimed after ClientHello processing finishes.
      
      Information about the CliehtHello is available to the callback by means of
      accessor functions that can only be used from the early callback.  This allows
      extensions to make use of the existing internal parsing machinery without
      exposing structure internals (e.g., of PACKET), so that applications do not
      have to write fragile parsing code.
      
      Applications are encouraged to utilize an early callback and not use
      a servername_callback, in order to avoid unexpected behavior that
      occurs due to the relative order of processing between things like
      session resumption and the historical servername callback.
      
      Also tidy up nearby style by removing unnecessary braces around one-line
      conditional bodies.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      6b1bb98f
    • B
      Prepare for WORK_MORE_C · ddf97258
      Benjamin Kaduk 提交于
      Add the new enum value and case statements as appropriate.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      ddf97258
    • B
      Refactor SSL_bytes_to_cipher_list() · 90134d98
      Benjamin Kaduk 提交于
      Split off the portions that mutate the SSL object into a separate
      function that the state machine calls, so that the public API can
      be a pure function.  (It still needs the SSL parameter in order
      to determine what SSL_METHOD's get_cipher_by_char() routine to use,
      though.)
      
      Instead of returning the stack of ciphers (functionality that was
      not used internally), require using the output parameter, and add
      a separate output parameter for the SCSVs contained in the supplied
      octets, if desired.  This lets us move to the standard return value
      convention.  Also make both output stacks optional parameters.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      90134d98
    • B
      Export SSL_bytes_to_cipher_list() · ccb8e6e0
      Benjamin Kaduk 提交于
      Move ssl_bytes_to_cipher_list() to ssl_lib.c and create a public
      wrapper around it.  This lets application early callbacks easily get
      SSL_CIPHER objects from the raw ciphers bytes without having to
      reimplement the parsing code.  In particular, they do not need to
      know the details of the sslv2 format ClientHello's ciphersuite
      specifications.
      
      Document the new public function, including the arguably buggy behavior
      of modifying the supplied SSL object.  On the face of it, such a function
      should be able to be pure, just a direct translation of wire octets to
      internal data structures.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      ccb8e6e0
    • B
      Let ssl_get_cipher_by_char yield not-valid ciphers · 60d685d1
      Benjamin Kaduk 提交于
      Now that we have made SCSVs into more of a first-class object, provide
      a way for the bytes-to-SSL_CIPHER conversion to actually return them.
      Add a flag 'all' to ssl_get_cipher_by_char to indicate that we want
      all the known ciphers, not just the ones valid for encryption.  This will,
      in practice, let the caller retrieve the SCSVs.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      60d685d1
    • B
      Store the number of extensions in CLIENTHELLO_MSG · 26f42684
      Benjamin Kaduk 提交于
      Keep track of the length of the pre_proc_exts array.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      26f42684
    • B
      output number of exts from tls_collect_extensions() · fc5ece2e
      Benjamin Kaduk 提交于
      Modify the API of tls_collect_extensions() to be able to output the number of
      extensions that are known (i.e., the length of its 'res' output).  This number
      can never be zero on a successful return due to the builtin extensions list,
      but use a separate output variable so as to not overload the return value
      semantics.
      
      Having this value easily available will give consumers a way to avoid repeating
      the calculation.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/2279)
      fc5ece2e
  2. 22 2月, 2017 1 次提交
  3. 17 2月, 2017 10 次提交
  4. 16 2月, 2017 1 次提交
    • M
      Don't change the state of the ETM flags until CCS processing · 28a31a0a
      Matt Caswell 提交于
      In 1.1.0 changing the ciphersuite during a renegotiation can result in
      a crash leading to a DoS attack. In master this does not occur with TLS
      (instead you get an internal error, which is still wrong but not a security
      issue) - but the problem still exists in the DTLS code.
      
      The problem is caused by changing the flag indicating whether to use ETM
      or not immediately on negotiation of ETM, rather than at CCS. Therefore,
      during a renegotiation, if the ETM state is changing (usually due to a
      change of ciphersuite), then an error/crash will occur.
      
      Due to the fact that there are separate CCS messages for read and write
      we actually now need two flags to determine whether to use ETM or not.
      
      CVE-2017-3733
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      28a31a0a
  5. 15 2月, 2017 5 次提交
  6. 14 2月, 2017 8 次提交
  7. 11 2月, 2017 1 次提交
  8. 04 2月, 2017 1 次提交
  9. 02 2月, 2017 4 次提交
  10. 01 2月, 2017 1 次提交
  11. 31 1月, 2017 1 次提交