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

Add support for trusted CA callbacks #2532

Merged
merged 29 commits into from Apr 16, 2019

Commits on Mar 28, 2019

  1. Add compile-time option to enable X.509 CA callbacks

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    288dedc View commit details
    Browse the repository at this point in the history
  2. Add X.509 CRT verification API using trusted CA callbacks

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    5c8df78 View commit details
    Browse the repository at this point in the history
  3. Improve documentation of old X.509 CRT verification functions

    This commit applies the documentation improvements noticed and applied
    while adding the documentation for the new X.509 CRT verification API
    mbedtls_x509_crt_verify_with_cb() to the existing verification APIs.
    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    902451d View commit details
    Browse the repository at this point in the history
  4. Add SSL configuration API for trusted CA callbacks

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    8bf74f3 View commit details
    Browse the repository at this point in the history
  5. Test for ca list callback

    Jarno Lamsa authored and Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    03cd120 View commit details
    Browse the repository at this point in the history
  6. Change callback name to ca_callback

    Jarno Lamsa authored and Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    912ed33 View commit details
    Browse the repository at this point in the history
  7. Add a failure testcase for ca callback

    Jarno Lamsa authored and Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    557426a View commit details
    Browse the repository at this point in the history
  8. Add possibility to use ca_callbacks in ssl programs

    Jarno Lamsa authored and Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    1b4a2ba View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5adaad9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    afd0b0a View commit details
    Browse the repository at this point in the history
  11. Add prototype for CRT verification with static and dynamic CA list

    So far, there were the following CRT verification functions:
    - `mbedtls_x509_crt_verify()` -- no profile, no restartable ECC
    - `mbedtls_x509_crt_verify_with_profile()` -- profile, no restartable ECC
    - `mbedtls_x509_crt_verify_restartable()` -- profile, restartable ECC
    all publicly declared and offering increasing functionality.
    
    On the implementation-side,
    - `mbedtls_x509_crt_verify()` resolves to
      a call to `mbedtls_x509_crt_verify_with_profile()` setting
      the profile to `NULL`, and
    - `mbedtls_x509_crt_verify_with_profile()`
      resolves to a call to ``mbedtls_x509_crt_verify_restartable()`
      setting the ECC restart context to NULL.
    
    This commit adds two more functions to this zoo:
    - `mbedtls_x509_crt_verify_with_cb()`
    - `x509_crt_verify_restartable_cb()`
    
    Here, `mbedtls_x509_crt_verify_with_cb()` is similar to
    `mbedtls_x509_crt_verify_with_profile()` but uses a CA callback
    instead of a static CA list, and no restart context.
    
    `x509_crt_verify_restartable_cb()` is similar to
    `mbedtls_x509_crt_verify_restartable()` but allows to either use
    a static list of trusted CAs _or_ a trusted CA callback.
    
    On the implementation-side,
    - the body of `mbedtls_x509_crt_verify_restartable()` is moved to
      `x509_crt_verify_restartable_cb()`, and the new version of
      `mbedtls_x509_crt_verify_restartable()` just resolves to
      `x509_crt_verify_restartable_cb()` with the trusted CA callback
      set to NULL.
    - The new function `mbedtls_x509_crt_verify_with_cb()`
      forward to `x509_crt_verify_restartable_cb()` with the restart
      context set to `NULL`.
    
    There's no change to the implementation yet, and in particular,
    `mbedtls_x509_crt_verify_with_cb()` isn't yet usable.
    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    3116fb3 View commit details
    Browse the repository at this point in the history
  12. Implement X.509 CRT verification using CA callback

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    f53893b View commit details
    Browse the repository at this point in the history
  13. Declare CA callback type even if feature is disabled

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    e15dae7 View commit details
    Browse the repository at this point in the history
  14. Minor fixes to CA callback tests

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    cbb5903 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    0350d56 View commit details
    Browse the repository at this point in the history
  16. Add ssl-opt.sh tests for trusted CA callbacks

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    746aaf3 View commit details
    Browse the repository at this point in the history
  17. Update query_config.c

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    fa738d1 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3f932bb View commit details
    Browse the repository at this point in the history
  19. Update version_features.c

    Hanno Becker committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    fed5d9d View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2019

  1. Correct placement of usage macro in ssl_client2

    Hanno Becker committed Mar 29, 2019
    Configuration menu
    Copy the full SHA
    1bac87c View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2019

  1. Fix ssl_client2 and ssl_server2 if !PLATFORM_C

    The CA callback changes introduce mbedtls_calloc() and
    mbedtls_free() to ssl_client2 and ssl_server2, which
    wasn't defined unless MBEDTLS_PLATFORM_C was set.
    Hanno Becker committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    d6d100b View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2019

  1. Change the verify function naming

    Change the naming to reflect that the function uses a new ca callback
    feature to distinguish different callbacks.
    Jarno Lamsa committed Apr 1, 2019
    Configuration menu
    Copy the full SHA
    31d9db6 View commit details
    Browse the repository at this point in the history
  2. Change docs according to review comments

    Jarno Lamsa committed Apr 1, 2019
    Configuration menu
    Copy the full SHA
    f49fedc View commit details
    Browse the repository at this point in the history
  3. Remove mbedtls_ from the static function name

    Jarno Lamsa committed Apr 1, 2019
    Configuration menu
    Copy the full SHA
    2ee67a6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f7a7f9e View commit details
    Browse the repository at this point in the history
  5. Address comments for x509 tests

    Jarno Lamsa committed Apr 1, 2019
    Configuration menu
    Copy the full SHA
    dfd22c4 View commit details
    Browse the repository at this point in the history
  6. Fix name to function call

    Jarno Lamsa committed Apr 1, 2019
    Configuration menu
    Copy the full SHA
    9822c0d View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2019

  1. Fix style issues and a typo

    yanesca committed Apr 5, 2019
    Configuration menu
    Copy the full SHA
    d7ecbd6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    846ae7a View commit details
    Browse the repository at this point in the history