From 7352bd141e09b076f5876b46ac7d3f7bf3dd8d9d Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sun, 1 Sep 2019 07:49:40 +0100 Subject: [PATCH] TinyCrypt SSL: Extend scope of SrvKeyExchange parsing 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 parsing of the ServerKeyExchange message. --- library/ssl_cli.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 22d28c959..6a90259c8 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -2830,9 +2830,11 @@ static int ssl_in_server_key_exchange_parse( mbedtls_ssl_context *ssl, MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ #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_PSK || + mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) + == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA ) { static const unsigned char ecdh_group[] = { MBEDTLS_SSL_EC_TLS_NAMED_CURVE,