From 8ea7da22503bfebbcfd65e9ad895b10f5d936cdd Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sun, 1 Sep 2019 07:48:52 +0100 Subject: [PATCH] TinyCrypt SSL: Extend scope of TC-based SrvKeyExch writing 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 writing of the ServerKeyExchange message. --- library/ssl_srv.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/library/ssl_srv.c b/library/ssl_srv.c index ecbfc852f..de3d57c5d 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -3415,10 +3415,6 @@ static int ssl_prepare_server_key_exchange( mbedtls_ssl_context *ssl, */ #if defined(MBEDTLS_USE_TINYCRYPT) - if( mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) - == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA || - mbedtls_ssl_suite_get_key_exchange( ciphersuite_info ) - == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ) { static const unsigned char ecdh_param_hdr[] = { MBEDTLS_SSL_EC_TLS_NAMED_CURVE, @@ -3446,13 +3442,6 @@ static int ssl_prepare_server_key_exchange( mbedtls_ssl_context *ssl, ssl->out_msglen += 2*NUM_ECC_BYTES; } - else -#endif /* MBEDTLS_TINYCRYPT_C */ -#if !defined(MBEDTLS_ECDH_C) - { - MBEDTLS_SSL_DEBUG_MSG( 1, ( "should never happen" ) ); - return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); - } #else { const mbedtls_ecp_curve_info *curve =