From ecf5d3fdb10e277a770df69853672e5c703b351b Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sun, 1 Sep 2019 07:47:29 +0100 Subject: [PATCH] TinyCrypt SSL: Extend scope of use of TC in PMS derivation Extend scope of TC in ECDH-param extraction from CRT Previously, TinyCrypt was only used for ECDHE-ECDSA/RSA ciphersuites. This commit is a step towards using it for _all_ ciphersuites involving ECDHE (specifically: ECDHE, ECDHE-PSK, static ECDH), extending the scope of the use of TinyCrypt in the assembly of the PMS. --- library/ssl_tls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 2e8a07645..75d199a64 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1952,9 +1952,13 @@ int mbedtls_ssl_build_pms( mbedtls_ssl_context *ssl ) #if defined(MBEDTLS_USE_TINYCRYPT) if( mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) - == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA || + == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA || mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) - == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ) + == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA || + mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) + == MBEDTLS_KEY_EXCHANGE_ECDH_RSA || + mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) + == MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA ) { const struct uECC_Curve_t * uecc_curve = uECC_secp256r1(); ((void) ret);