1. 09 3月, 2018 1 次提交
  2. 05 3月, 2018 1 次提交
    • M
      Fix status_request and SCT extensions · 5de683d2
      Matt Caswell 提交于
      They are valid for use in a CertificateRequest message, but we did not
      allow it. If a server sent such a message using either of those two
      extensions then the handshake would abort.
      
      This corrects that error, but does not add support for actually processing
      the extensions. They are simply ignored, and a TODO is inserted to add
      support at a later time.
      
      This was found during interoperability testing with btls:
      https://gitlab.com/ilari_l/btls
      
      Prompted by these errors I reviewed the complete list of extensions and
      compared them with the latest table in draft-24 to confirm there were no
      other errors of a similar type. I did not find any.
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      (Merged from https://github.com/openssl/openssl/pull/5490)
      5de683d2
  3. 15 2月, 2018 1 次提交
  4. 14 2月, 2018 1 次提交
  5. 02 2月, 2018 2 次提交
    • T
      Fix some minor code nits · e43e6b19
      Todd Short 提交于
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4964)
      e43e6b19
    • T
      Add TLSv1.3 post-handshake authentication (PHA) · 9d75dce3
      Todd Short 提交于
      Add SSL_verify_client_post_handshake() for servers to initiate PHA
      
      Add SSL_force_post_handshake_auth() for clients that don't have certificates
      initially configured, but use a certificate callback.
      
      Update SSL_CTX_set_verify()/SSL_set_verify() mode:
      
      * Add SSL_VERIFY_POST_HANDSHAKE to postpone client authentication until after
      the initial handshake.
      
      * Update SSL_VERIFY_CLIENT_ONCE now only sends out one CertRequest regardless
      of when the certificate authentication takes place; either initial handshake,
      re-negotiation, or post-handshake authentication.
      
      Add 'RequestPostHandshake' and 'RequirePostHandshake' SSL_CONF options that
      add the SSL_VERIFY_POST_HANDSHAKE to the 'Request' and 'Require' options
      
      Add support to s_client:
      * Enabled automatically when cert is configured
      * Can be forced enabled via -force_pha
      
      Add support to s_server:
      * Use 'c' to invoke PHA in s_server
      * Remove some dead code
      
      Update documentation
      
      Update unit tests:
      * Illegal use of PHA extension
      * TLSv1.3 certificate tests
      
      DTLS and TLS behave ever-so-slightly differently. So, when DTLS1.3 is
      implemented, it's PHA support state machine may need to be different.
      Add a TODO and a #error
      
      Update handshake context to deal with PHA.
      
      The handshake context for TLSv1.3 post-handshake auth is up through the
      ClientFinish message, plus the CertificateRequest message. Subsequent
      Certificate, CertificateVerify, and Finish messages are based on this
      handshake context (not the Certificate message per se, but it's included
      after the hash). KeyUpdate, NewSessionTicket, and prior Certificate
      Request messages are not included in post-handshake authentication.
      
      After the ClientFinished message is processed, save off the digest state
      for future post-handshake authentication. When post-handshake auth occurs,
      copy over the saved handshake context into the "main" handshake digest.
      This effectively discards the any KeyUpdate or NewSessionTicket messages
      and any prior post-handshake authentication.
      
      This, of course, assumes that the ID-22 did not mean to include any
      previous post-handshake authentication into the new handshake transcript.
      This is implied by section 4.4.1 that lists messages only up to the
      first ClientFinished.
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4964)
      9d75dce3
  6. 26 1月, 2018 1 次提交
    • B
      Add support for the TLS 1.3 signature_algorithms_cert extension · c589c34e
      Benjamin Kaduk 提交于
      The new extension is like signature_algorithms, but only for the
      signature *on* the certificate we will present to the peer (the
      old signature_algorithms extension is still used for signatures that
      we *generate*, i.e., those over TLS data structures).
      
      We do not need to generate this extension, since we are the same
      implementation as our X.509 stack and can handle the same types
      of signatures, but we need to be prepared to receive it, and use the received
      information when selecting what certificate to present.
      
      There is a lot of interplay between signature_algorithms_cert and
      signature_algorithms, since both affect what certificate we can
      use, and thus the resulting signature algorithm used for TLS messages.
      So, apply signature_algorithms_cert (if present) as a filter on what
      certificates we can consider when choosing a certificate+sigalg
      pair.
      
      As part of this addition, we also remove the fallback code that let
      keys of type EVP_PKEY_RSA be used to generate RSA-PSS signatures -- the
      new rsa_pss_pss_* and rsa_pss_rsae_* signature schemes have pulled
      the key type into what is covered by the signature algorithm, so
      we should not apply this sort of compatibility workaround.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/5068)
      c589c34e
  7. 25 1月, 2018 3 次提交
  8. 09 1月, 2018 1 次提交
  9. 03 1月, 2018 1 次提交
    • B
      Permit the "supported_groups" extension in ServerHellos · 7bc2bddb
      Benjamin Kaduk 提交于
      Although this is forbidden by all three(!) relevant specifications,
      there seem to be multiple server implementations in the wild that
      send it.  Since we didn't check for unexpected extensions in any
      given message type until TLS 1.3 support was added, our previous
      behavior was to silently accept these extensions and pass them over
      to the custom extension callback (if any).  In order to avoid
      regression of functionality, relax the check for "extension in
      unexpected context" for this specific case, but leave the protocol
      enforcment mechanism unchanged for other extensions and in other
      extension contexts.
      
      Leave a detailed comment to indicate what is going on.
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4463)
      7bc2bddb
  10. 18 12月, 2017 1 次提交
  11. 14 12月, 2017 3 次提交
  12. 04 12月, 2017 3 次提交
  13. 22 11月, 2017 1 次提交
  14. 06 11月, 2017 1 次提交
  15. 30 10月, 2017 1 次提交
    • B
      Provide SSL_CTX.stats.sess_accept for switched ctxs · 3be08e30
      Benjamin Kaduk 提交于
      We currently increment the SSL_CTX stats.sess_accept field in
      tls_setup_handshake(), which is invoked from the state machine well
      before ClientHello processing would have had a chance to switch
      the SSL_CTX attached to the SSL object due to a provided SNI value.
      However, stats.sess_accept_good is incremented in tls_finish_handshake(),
      and uses the s->ctx.stats field (i.e., the new SSL_CTX that was switched
      to as a result of SNI processing).  This leads to the confusing
      (nonsensical) situation where stats.sess_accept_good is larger than
      stats.sess_accept, as the "sess_accept" value was counted on the
      s->session_ctx.
      
      In order to provide some more useful numbers, increment
      s->ctx.stats.sess_accept after SNI processing if the SNI processing
      changed s->ctx to differ from s->session_ctx.  To preserve the
      property that any given accept is counted only once, make the
      corresponding decrement to s->session_ctx.stats.sess_accept when
      doing so.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/4549)
      3be08e30
  16. 16 10月, 2017 1 次提交
    • M
      Don't do version neg on an HRR · a2b97bdf
      Matt Caswell 提交于
      Previously if a client received an HRR then we would do version negotiation
      immediately - because we know we are going to get TLSv1.3. However this
      causes a problem when we emit the 2nd ClientHello because we start changing
      a whole load of stuff to ommit things that aren't relevant for < TLSv1.3.
      The spec requires that the 2nd ClientHello is the same except for changes
      required from the HRR. Therefore the simplest thing to do is to defer the
      version negotiation until we receive the ServerHello.
      
      Fixes #4292
      Reviewed-by: NTim Hudson <tjh@openssl.org>
      Reviewed-by: NBen Kaduk <kaduk@mit.edu>
      (Merged from https://github.com/openssl/openssl/pull/4527)
      a2b97bdf
  17. 12 10月, 2017 1 次提交
  18. 06 10月, 2017 2 次提交
  19. 04 10月, 2017 1 次提交
    • T
      Session resume broken switching contexts · a84e5c9a
      Todd Short 提交于
      When an SSL's context is swtiched from a ticket-enabled context to
      a ticket-disabled context in the servername callback, no session-id
      is generated, so the session can't be resumed.
      
      If a servername callback changes the SSL_OP_NO_TICKET option, check
      to see if it's changed to disable, and whether a session ticket is
      expected (i.e. the client indicated ticket support and the SSL had
      tickets enabled at the time), and whether we already have a previous
      session (i.e. s->hit is set).
      
      In this case, clear the ticket-expected flag, remove any ticket data
      and generate a session-id in the session.
      
      If the SSL hit (resumed) and switched to a ticket-disabled context,
      assume that the resumption was via session-id, and don't bother to
      update the session.
      
      Before this fix, the updated unit-tests in 06-sni-ticket.conf would
      fail test #4 (server1 = SNI, server2 = no SNI).
      Reviewed-by: NRich Salz <rsalz@openssl.org>
      Reviewed-by: NRichard Levitte <levitte@openssl.org>
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/1529)
      a84e5c9a
  20. 26 9月, 2017 1 次提交
  21. 23 9月, 2017 1 次提交
  22. 07 9月, 2017 1 次提交
    • B
      Restore historical behavior for absent ServerHello extensions · 1c259bb5
      Benjamin Kaduk 提交于
      In OpenSSL 1.1.0, when there were no extensions added to the ServerHello,
      we did not write the extension data length bytes to the end of the
      ServerHello; this is needed for compatibility with old client implementations
      that do not support TLS extensions (such as the default configuration of
      OpenSSL 0.9.8).  When ServerHello extension construction was converted
      to the new extensions framework in commit
      7da160b0, this behavior was inadvertently
      limited to cases when SSLv3 was negotiated (and similarly for ClientHellos),
      presumably since extensions are not defined at all for SSLv3.  However,
      extensions for TLS prior to TLS 1.3 have been defined in separate
      RFCs (6066, 4366, and 3546) from the TLS protocol specifications, and as such
      should be considered an optional protocol feature in those cases.
      
      Accordingly, be conservative in what we send, and skip the extensions block
      when there are no extensions to be sent, regardless of the TLS/SSL version.
      (TLS 1.3 requires extensions and can safely be treated differently.)
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/4296)
      1c259bb5
  23. 31 8月, 2017 3 次提交
  24. 30 8月, 2017 1 次提交
  25. 18 8月, 2017 1 次提交
  26. 15 8月, 2017 1 次提交
    • B
      Move ALPN handling from finalizer to delayed call · 5626f634
      Benjamin Kaduk 提交于
      Commit 02f0274e moved ALPN processing
      into an extension finalization function, as the only documented ordering
      requirement from previous commits was that ALPN processing occur after
      SNI processing, and SNI processing is performed before the extension
      finalization step.  However, it is useful for applications'
      alpn_select callbacks to run after ciphersuite selection as well -- at
      least one application protocol specification (HTTP/2) imposes restrictions
      on which ciphersuites are usable with that protocol.  Since it is generally
      more preferrable to have a successful TLS connection with a default application
      protocol than to fail the TLS connection and not be able to have the preferred
      application protocol, it is good to give the alpn_select callback information
      about the ciphersuite to be used, so that appropriate restrctions can be
      enforced in application code.
      
      Accordingly, split the ALPN handling out into a separate tls_handl_alpn()
      function akin to tls_handle_status_request(), called from
      tls_post_process_client_hello().  This is an alternative to resuscitating
      ssl_check_clienthello_tlsext_late(), something of an awkwward name itself.
      Reviewed-by: NMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/4070)
      5626f634
  27. 11 8月, 2017 1 次提交
  28. 01 8月, 2017 1 次提交
  29. 18 7月, 2017 1 次提交
  30. 07 7月, 2017 1 次提交