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.
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index ecbfc85..de3d57c 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -3415,10 +3415,6 @@
*/
#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 @@
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 =