From b42e2388ff644166e037079834f81bb7f69e0563 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sun, 1 Sep 2019 07:49:04 +0100 Subject: [PATCH] TinyCrypt SSL: Extend scope of CliKeyExchange parsing 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 ClientKeyExchange message. --- library/ssl_srv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index de3d57c5d..1c1ca32f5 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -4219,9 +4219,13 @@ static int ssl_in_client_key_exchange_parse( mbedtls_ssl_context *ssl, #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_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_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 ) { ((void) ret); if( mbedtls_ssl_ecdh_read_peerkey( ssl, &p, end ) != 0 )