net/tls: fix a potential security hole that bypasses signature verification
This commit fixes a critical issue about ECDH_ANON key-exchange. When
MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED is enabled, TLS client could
bypass the signature verification and it would makes security hole.
@@ -2149,7 +2149,9 @@ defined(MBEDTLS_SSL_PROTO_TLS1_1)
// Anonim cipher suite without sign, ecdh param only
#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED)
+ if (ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDH_ANON) {
goto exit;
+ }
#endif
/*
* Read signature
