Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: support BoringSSL private key async functionality #6326

Merged
merged 63 commits into from
Aug 22, 2019

Commits on Mar 27, 2019

  1. tls: support BoringSSL private key async functionality.

    Opens:
    
      1. Validate the thread model. Now there is an unique PrivateKeyOperations
         instance for each connection, but the PrivateKeyOperationsProvider is shared.
         This makes the dispatcher model easier and the PrivateKeyOperations lifecycle
         can be tied with the caller.
      2. How to get the private key to the provider? Just let the provider use
         SSL_get_privatekey()?
      3. Does SDS require any special handling?
      4. Should we expose BoringSSL primitives (such as 'SSL *ssl') in the API?
      5. Automatic registration of PrivateKeyOperationsProvider extensions to the
         PrivateKeyOperationsManager. We need a
         NamedPrivateKeyOperationsProviderConfigFactory?
      6. Is the API sufficient for all private key users?
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Mar 27, 2019
    Configuration menu
    Copy the full SHA
    3ab2e1d View commit details
    Browse the repository at this point in the history
  2. tls: add BoringSSL private key operations provider manager support.

    The private key operations manager allows extensions to register
    private key operations provider factories. These factories in turn
    create providers for individual SSL contexts.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Mar 27, 2019
    Configuration menu
    Copy the full SHA
    84b6fe1 View commit details
    Browse the repository at this point in the history
  3. tests: add mock privateKeyOperationsManager() method.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Mar 27, 2019
    Configuration menu
    Copy the full SHA
    127bff5 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2019

  1. tls: use typed config for private key provider configuration.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    e58ddfd View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2019

  1. tls: fixed handling of getPrivateKeyMethods() failure.

    Also nicer handling of Protobuf message existence.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Apr 5, 2019
    Configuration menu
    Copy the full SHA
    8d91d59 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2019

  1. tls: change BoringSSL private key support to be certificate-based.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Apr 17, 2019
    Configuration menu
    Copy the full SHA
    0bd6f25 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2019

  1. tls: remove associateWithSsl(), fix tests.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    5e01b30 View commit details
    Browse the repository at this point in the history
  2. tls: rename the private key API to be more in line with BoringSSL.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    8717cb2 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2019

  1. tls: make a failed private key method association fatal.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Apr 30, 2019
    Configuration menu
    Copy the full SHA
    7f0e0bc View commit details
    Browse the repository at this point in the history

Commits on May 9, 2019

  1. tls: typo fix.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 9, 2019
    Configuration menu
    Copy the full SHA
    4855c9e View commit details
    Browse the repository at this point in the history
  2. test: start testing private key methods (context and ssl_socket).

    Add a RSA private key method provider. Use that for validating the
    SSL socket interaction.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 9, 2019
    Configuration menu
    Copy the full SHA
    b25f6a6 View commit details
    Browse the repository at this point in the history
  3. dictionary: added words.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 9, 2019
    Configuration menu
    Copy the full SHA
    b7f4fa3 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2019

  1. test: add a missing "override".

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 10, 2019
    Configuration menu
    Copy the full SHA
    f67c1a1 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2019

  1. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 13, 2019
    Configuration menu
    Copy the full SHA
    b24ceb2 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2019

  1. tls: close connection if async handshake fails.

    if the second half of asynchronous private key method fails (meaning
    that the operation itself failed or the second call to
    SSL_do_handshake() failed), just call the connection to be closed.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 14, 2019
    Configuration menu
    Copy the full SHA
    ce312ec View commit details
    Browse the repository at this point in the history
  2. tests: add more tests for private key method error cases.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 14, 2019
    Configuration menu
    Copy the full SHA
    3eacd75 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2019

  1. tls: remove status from private key method complete() callback.

    BoringSSL pattern seems to be that no-one takes a fast path without
    calling the SSL_do_hanshake() again. This means that the operators need
    to communicate errors in the private key complete method by returning
    `ssl_private_key_failure`.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 15, 2019
    Configuration menu
    Copy the full SHA
    81afc58 View commit details
    Browse the repository at this point in the history
  2. tests: update tests to the new API + cleanups.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 15, 2019
    Configuration menu
    Copy the full SHA
    ccc8fbe View commit details
    Browse the repository at this point in the history
  3. tls: add a check for having both private_key and private_key_method.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 15, 2019
    Configuration menu
    Copy the full SHA
    3e8a3c3 View commit details
    Browse the repository at this point in the history
  4. tests: test having both private_key and private_key_method in certifi…

    …cate config.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 15, 2019
    Configuration menu
    Copy the full SHA
    59d93f6 View commit details
    Browse the repository at this point in the history
  5. cert.proto: fix numbering to be contiguous.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 15, 2019
    Configuration menu
    Copy the full SHA
    eb1feaa View commit details
    Browse the repository at this point in the history

Commits on May 27, 2019

  1. test: fail if provider doesn't return private key methods.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 27, 2019
    Configuration menu
    Copy the full SHA
    f7ccf0b View commit details
    Browse the repository at this point in the history
  2. test: rewrote rsa private key method logic.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 27, 2019
    Configuration menu
    Copy the full SHA
    dace6bb View commit details
    Browse the repository at this point in the history
  3. tests: fix a typo.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 27, 2019
    Configuration menu
    Copy the full SHA
    1c5630d View commit details
    Browse the repository at this point in the history

Commits on May 28, 2019

  1. tests: private key method multi-cert tests.

    Add a very basic ECDSA private key method provider. Some tests to verify
    that the provider works, and then to see that the correct private key
    method is used in a case where there are several private key methods
    added for a TLS context.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 28, 2019
    Configuration menu
    Copy the full SHA
    c92dfd6 View commit details
    Browse the repository at this point in the history
  2. dispatcher: add a function for returning current thread id.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 28, 2019
    Configuration menu
    Copy the full SHA
    86ecba9 View commit details
    Browse the repository at this point in the history
  3. ssl_socket: check the private key method callback thread id.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed May 28, 2019
    Configuration menu
    Copy the full SHA
    3cbe3a5 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2019

  1. tests: unique pointers, vectors, and cleanups.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 3, 2019
    Configuration menu
    Copy the full SHA
    976a469 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2019

  1. tls: cleanups.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    789368a View commit details
    Browse the repository at this point in the history
  2. tls: complete() -> onPrivateKeyMethodComplete()

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    50d6450 View commit details
    Browse the repository at this point in the history
  3. tests: FIPS check, private key read from disk only once.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    9146b40 View commit details
    Browse the repository at this point in the history
  4. tls: fix typos.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 4, 2019
    Configuration menu
    Copy the full SHA
    8a688f6 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2019

  1. tests: checkFips() implementation.

    Also add one-time key read to ECDSA provider.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    455be73 View commit details
    Browse the repository at this point in the history
  2. tls: remove one of three TlsCertificateConfig constructors.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    14b6d33 View commit details
    Browse the repository at this point in the history
  3. tests: remove use of old TlsCertificateConfigImpl constructor.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    cc54803 View commit details
    Browse the repository at this point in the history
  4. tls: remove PrivateKeyMethodConnection class.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    12680f6 View commit details
    Browse the repository at this point in the history
  5. tests: use higher-level RSA signing functions.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    16ca2a1 View commit details
    Browse the repository at this point in the history
  6. tests: do not use locking in test providers.

    SSL_set_ex_data() doesn't seem to support smart pointers though.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    6d5cf6f View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2019

  1. docs: add an overview and some API documentation.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    e3a66fe View commit details
    Browse the repository at this point in the history
  2. dictionary: add "TPM".

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    6ac9b30 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    caee5ad View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2019

  1. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    1f1c997 View commit details
    Browse the repository at this point in the history
  2. tls: style cleanups.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    2ef535f View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2019

  1. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 19, 2019
    Configuration menu
    Copy the full SHA
    c4a5836 View commit details
    Browse the repository at this point in the history
  2. tls: reduce TlsCertificateConfigImpl constructors to one.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 19, 2019
    Configuration menu
    Copy the full SHA
    2498b0f View commit details
    Browse the repository at this point in the history
  3. tls: simplify private key method callback. Add some assumptions to th…

    …e private key method providers:
    
     1. After calling the completition callback, the providers are not
        allowed to return ssl_private_key_retry from the BoringSSL complete
        function.
     2. The providers are not allowed to return any other value than
        ssl_private_key_retry from the BoringSSL complete function before
        calling the completition callback.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 19, 2019
    Configuration menu
    Copy the full SHA
    cd28e08 View commit details
    Browse the repository at this point in the history
  4. Add transport_sockets/tls/private_key to unowned directories.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 19, 2019
    Configuration menu
    Copy the full SHA
    d7e9e5a View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. CODEOWNERS: add @PiotrSikora and @lizan to transport_sockets/tls.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    9b31b1a View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2019

  1. tests: merged RSA and ECDSA providers.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 25, 2019
    Configuration menu
    Copy the full SHA
    c9ec2bc View commit details
    Browse the repository at this point in the history
  2. tls: change from PrivateKeyMethod to PrivateKeyProvider.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 25, 2019
    Configuration menu
    Copy the full SHA
    9a321eb View commit details
    Browse the repository at this point in the history
  3. tests: change how the crypto error is done in private key method test.

    It seems that flipping the bits in the output data first byte may
    sometimes cause the connection to succeed anyway: it may be that it only
    touches the crypto header. Changing the digest which is signed should
    cause the handshake to reliably fail however.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 25, 2019
    Configuration menu
    Copy the full SHA
    7ec959e View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2019

  1. test: fix typo in comment.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    f35cca5 View commit details
    Browse the repository at this point in the history
  2. tests: improved an error message.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jun 27, 2019
    Configuration menu
    Copy the full SHA
    0a51246 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2019

  1. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jul 15, 2019
    Configuration menu
    Copy the full SHA
    808d046 View commit details
    Browse the repository at this point in the history
  2. tls: change "typedef" to "using".

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jul 15, 2019
    Configuration menu
    Copy the full SHA
    3f57152 View commit details
    Browse the repository at this point in the history
  3. test: remove redundant return.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jul 15, 2019
    Configuration menu
    Copy the full SHA
    ed99c59 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2019

  1. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jul 23, 2019
    Configuration menu
    Copy the full SHA
    4d1ceca View commit details
    Browse the repository at this point in the history
  2. tests: annotated destructors with override.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Jul 23, 2019
    Configuration menu
    Copy the full SHA
    e4cab89 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2019

  1. tls: gather bools into an enum.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    5db871c View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/master' into private-key-pr-1.3-…

    …merged
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    e0e4ed7 View commit details
    Browse the repository at this point in the history
  3. tests: update one new TlsCertificateConfigImpl constructor.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    d28d44b View commit details
    Browse the repository at this point in the history
  4. tls: modernize a for loop.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    b79e532 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2019

  1. tls: various variable name and comment cleanups.

    Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
    ipuustin committed Aug 22, 2019
    Configuration menu
    Copy the full SHA
    abf8758 View commit details
    Browse the repository at this point in the history