1. 28 5月, 2019 1 次提交
  2. 27 5月, 2019 1 次提交
  3. 12 11月, 2018 1 次提交
    • M
      Separate ca_names handling for client and server · b4970e8b
      Matt Caswell 提交于
      SSL(_CTX)?_set_client_CA_list() was a server side only function in 1.1.0.
      If it was called on the client side then it was ignored. In 1.1.1 it now
      makes sense to have a CA list defined for both client and server (the
      client now sends it the the TLSv1.3 certificate_authorities extension).
      Unfortunately some applications were using the same SSL_CTX for both
      clients and servers and this resulted in some client ClientHellos being
      excessively large due to the number of certificate authorities being sent.
      
      This commit seperates out the CA list updated by
      SSL(_CTX)?_set_client_CA_list() and the more generic
      SSL(_CTX)?_set0_CA_list(). This means that SSL(_CTX)?_set_client_CA_list()
      still has no effect on the client side. If both CA lists are set then
      SSL(_CTX)?_set_client_CA_list() takes priority.
      
      Fixes #7411
      Reviewed-by: NViktor Dukhovni <viktor@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/7503)
      
      (cherry picked from commit 98732979001dbb59320803713c4c91ba40234250)
      b4970e8b
  4. 06 11月, 2018 2 次提交
  5. 20 9月, 2018 1 次提交
    • B
      Reset TLS 1.3 ciphers in SSL_CTX_set_ssl_version() · 1766493b
      Benjamin Kaduk 提交于
      Historically SSL_CTX_set_ssl_version() has reset the cipher list
      to the default.  Splitting TLS 1.3 ciphers to be tracked separately
      caused a behavior change, in that TLS 1.3 cipher configuration was
      preserved across calls to SSL_CTX_set_ssl_version().  To restore commensurate
      behavior with the historical behavior, set the ciphersuites to the default as
      well as setting the cipher list to the default.
      
      Closes: #7226
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/7270)
      
      (cherry picked from commit 2340ed277b7c5365e83a32eb7d5fa32c4071fb21)
      1766493b
  6. 08 9月, 2018 1 次提交
  7. 07 9月, 2018 1 次提交
    • B
      Simplify SSL_get_servername() to avoid session references · 328a0547
      Ben Kaduk 提交于
      Ideally, SSL_get_servername() would do exactly as it is documented
      and return exactly what the client sent (i.e., what we currently
      are stashing in the SSL's ext.hostname), without needing to refer
      to an SSL_SESSION object.  For historical reasons, including the
      parsed SNI value from the ClientHello originally being stored in the
      SSL_SESSION's ext.hostname field, we have had references to the
      SSL_SESSION in this function.  We cannot fully excise them due to
      the interaction between user-supplied callbacks and TLS 1.2 resumption
      flows, where we call all callbacks but the client did not supply an
      SNI value.  Existing callbacks expect to receive a valid SNI value
      in this case, so we must fake one up from the resumed session in
      order to avoid breakage.
      
      Otherwise, greatly simplify the implementation and just return the
      value in the SSL, as sent by the client.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/7115)
      328a0547
  8. 20 8月, 2018 2 次提交
  9. 07 8月, 2018 1 次提交
  10. 27 7月, 2018 1 次提交
    • B
      Improve backwards compat for SSL_get_servername() · a75be9fd
      Benjamin Kaduk 提交于
      Commit 1c4aa31d changed how we process
      and store SNI information during the handshake, so that a hostname is
      only saved in the SSL_SESSION structure if that SNI value has actually
      been negotiated.  SSL_get_servername() was adjusted to match, with a new
      conditional being added to handle the case when the handshake processing
      is ongoing, and a different location should be consulted for the offered
      SNI value.  This was done in an attempt to preserve the historical
      behavior of SSL_get_servername(), a function whose behavior only mostly
      matches its documentation, and whose documentation is both lacking and
      does not necessarily reflect the actual desired behavior for such an
      API.  Unfortunately, sweeping changes that would bring more sanity to
      this space are not possible until OpenSSL 1.2.0, for ABI compatibility
      reasons, so we must attempt to maintain the existing behavior to the
      extent possible.
      
      The above-mentioned commit did not take into account the behavior
      of SSL_get_servername() during resumption handshakes for TLS 1.2 and
      prior, where no SNI negotiation is performed.  In that case we would
      not properly parse the incoming SNI and erroneously return NULL as
      the servername, when instead the logical session is associated with
      the SNI value cached in the SSL_SESSION.  (Note that in some cases an
      SNI callback may not need to do anything in a TLS 1.2 or prior resumption
      flow, but we are calling the callbacks and did not provide any guidance
      that they should no-op if the connection is being resumed, so we must
      handle this case in a usable fashion.)  Update our behavior accordingly to
      return the session's cached value during the handshake, when resuming.
      This fixes the boringssl tests.
      
      [extended tests]
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/6792)
      a75be9fd
  11. 20 7月, 2018 1 次提交
    • B
      Normalize SNI hostname handling for SSL and SSL_SESSION · 1c4aa31d
      Benjamin Kaduk 提交于
      In particular, adhere to the rule that we must not modify any
      property of an SSL_SESSION object once it is (or might be) in
      a session cache.  Such modifications are thread-unsafe and have
      been observed to cause crashes at runtime.
      
      To effect this change, standardize on the property that
      SSL_SESSION->ext.hostname is set only when that SNI value
      has been negotiated by both parties for use with that session.
      For session resumption this is trivially the case, so only new
      handshakes are affected.
      
      On the client, the new semantics are that the SSL->ext.hostname is
      for storing the value configured by the caller, and this value is
      used when constructing the ClientHello.  On the server, SSL->ext.hostname
      is used to hold the value received from the client.  Only if the
      SNI negotiation is successful will the hostname be stored into the
      session object; the server can do this after it sends the ServerHello,
      and the client after it has received and processed the ServerHello.
      
      This obviates the need to remove the hostname from the session object
      in case of failed negotiation (a change that was introduced in commit
      9fb6cb81 in order to allow TLS 1.3
      early data when SNI was present in the ClientHello but not the session
      being resumed), which was modifying cached sessions in certain cases.
      (In TLS 1.3 we always produce a new SSL_SESSION object for new
      connections, even in the case of resumption, so no TLS 1.3 handshakes
      were affected.)
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/6378)
      1c4aa31d
  12. 06 7月, 2018 1 次提交
    • M
      Introduce the recv_max_early_data setting · 4e8548e8
      Matt Caswell 提交于
      Previoulsy we just had max_early_data which controlled both the value of
      max early_data that we advertise in tickets *and* the amount of early_data
      that we are willing to receive from clients. This doesn't work too well in
      the case where we want to reduce a previously advertised max_early_data
      value. In that case clients with old, stale tickets may attempt to send us
      more early data than we are willing to receive. Instead of rejecting the
      early data we abort the connection if that happens.
      
      To avoid this we introduce a new "recv_max_early_data" value. The old
      max_early_data becomes the value that is advertised in tickets while
      recv_max_early_data is the maximum we will tolerate from clients.
      
      Fixes #6647
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/6655)
      4e8548e8
  13. 02 7月, 2018 2 次提交
  14. 27 6月, 2018 1 次提交
  15. 23 5月, 2018 1 次提交
    • K
      Enable SSL_MODE_AUTO_RETRY by default · 693cf80c
      Kurt Roeckx 提交于
      Because TLS 1.3 sends more non-application data records some clients run
      into problems because they don't expect SSL_read() to return and set
      SSL_ERROR_WANT_READ after processing it.
      
      This can cause problems for clients that use blocking I/O and use
      select() to see if data is available. It can be cleared using
      SSL_CTX_clear_mode().
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      GH: #6260
      693cf80c
  16. 21 5月, 2018 1 次提交
    • M
      Don't cache stateless tickets in TLSv1.3 · ee94ec2e
      Matt Caswell 提交于
      In TLSv1.2 and below we always cache new sessions by default on the server
      side in the internal cache (even when we're using session tickets). This is
      in order to support resumption from a session id.
      
      In TLSv1.3 there is no session id. It is only possible to resume using the
      ticket. Therefore, in the default case,  there is no point in caching the
      session in the internal store.
      
      There is still a reason to call the external cache new session callback
      because applications may be using the callbacks just to know about when
      sessions are created (and not necessarily implementing a full cache). If
      the application also implements the remove session callback then we are
      forced to also store it in the internal cache so that we can create
      timeout events. Otherwise the external cache could just fill up
      indefinitely.
      
      This mostly addresses the issue described in #5628. That issue also proposes
      having an option to not create full stateless tickets when using the
      internal cache. That aspect hasn't been addressed yet.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      (Merged from https://github.com/openssl/openssl/pull/6293)
      ee94ec2e
  17. 17 5月, 2018 2 次提交
  18. 11 5月, 2018 1 次提交
  19. 03 5月, 2018 1 次提交
  20. 02 5月, 2018 1 次提交
    • B
      Fix regression with session cache use by clients · c4fa1f7f
      Benjamin Kaduk 提交于
      Commit d316cdcf introduced some extra
      checks into the session-cache update procedure, intended to prevent
      the caching of sessions whose resumption would lead to a handshake
      failure, since if the server is authenticating the client, there needs to
      be an application-set "session id context" to match up to the authentication
      context.  While that change is effective for its stated purpose, there
      was also some collatoral damage introduced along with the fix -- clients
      that set SSL_VERIFY_PEER are not expected to set an sid_ctx, and so
      their usage of session caching was erroneously denied.
      
      Fix the scope of the original commit by limiting it to only acting
      when the SSL is a server SSL.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5967)
      c4fa1f7f
  21. 18 4月, 2018 1 次提交
  22. 04 4月, 2018 1 次提交
  23. 03 4月, 2018 2 次提交
  24. 28 3月, 2018 2 次提交
  25. 21 3月, 2018 1 次提交
    • B
      Do not cache sessions with zero sid_ctx_length when SSL_VERIFY_PEER · d316cdcf
      Benjamin Kaduk 提交于
      The sid_ctx is something of a "certificate request context" or a
      "session ID context" -- something from the application that gives
      extra indication of what sort of thing this session is/was for/from.
      Without a sid_ctx, we only know that there is a session that we
      issued, but it could have come from a number of things, especially
      with an external (shared) session cache.  Accordingly, when resuming,
      we will hard-error the handshake when presented with a session with
      zero-length sid_ctx and SSL_VERIFY_PEER is set -- we simply have no
      information about the peer to verify, so the verification must fail.
      
      In order to prevent these future handshake failures, proactively
      decline to add the problematic sessions to the session cache.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5175)
      d316cdcf
  26. 19 3月, 2018 3 次提交
  27. 17 3月, 2018 1 次提交
  28. 16 3月, 2018 1 次提交
  29. 14 3月, 2018 2 次提交
  30. 12 3月, 2018 1 次提交
  31. 09 3月, 2018 1 次提交