mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Remove useless selected_group
Change-Id: I5fb76b5bf4b22d0231c17314783781f9e7c309a3 Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
This commit is contained in:
@ -589,8 +589,6 @@ struct mbedtls_ssl_handshake_params
|
|||||||
#if defined(MBEDTLS_SSL_SRV_C)
|
#if defined(MBEDTLS_SSL_SRV_C)
|
||||||
/** selected_group of key_share extension in HelloRetryRequest message. */
|
/** selected_group of key_share extension in HelloRetryRequest message. */
|
||||||
uint16_t hrr_selected_group;
|
uint16_t hrr_selected_group;
|
||||||
/** selected_group of key_share extension in ClientHello message. */
|
|
||||||
uint16_t selected_group;
|
|
||||||
#endif /* MBEDTLS_SSL_SRV_C */
|
#endif /* MBEDTLS_SSL_SRV_C */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
|
||||||
|
@ -115,7 +115,7 @@ static int ssl_tls13_parse_supported_groups_ext(
|
|||||||
p += 2;
|
p += 2;
|
||||||
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, named_group_list_len );
|
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, named_group_list_len );
|
||||||
named_group_list_end = p + named_group_list_len;
|
named_group_list_end = p + named_group_list_len;
|
||||||
ssl->handshake->selected_group = 0;
|
ssl->handshake->hrr_selected_group = 0;
|
||||||
|
|
||||||
while( p < named_group_list_end )
|
while( p < named_group_list_end )
|
||||||
{
|
{
|
||||||
@ -128,7 +128,7 @@ static int ssl_tls13_parse_supported_groups_ext(
|
|||||||
|
|
||||||
if( ! mbedtls_ssl_named_group_is_offered( ssl, named_group ) ||
|
if( ! mbedtls_ssl_named_group_is_offered( ssl, named_group ) ||
|
||||||
! mbedtls_ssl_named_group_is_supported( named_group ) ||
|
! mbedtls_ssl_named_group_is_supported( named_group ) ||
|
||||||
ssl->handshake->selected_group != 0 )
|
ssl->handshake->hrr_selected_group != 0 )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ static int ssl_tls13_parse_supported_groups_ext(
|
|||||||
MBEDTLS_SSL_DEBUG_MSG(
|
MBEDTLS_SSL_DEBUG_MSG(
|
||||||
2, ( "add named group (%04x) into received list.",
|
2, ( "add named group (%04x) into received list.",
|
||||||
named_group ) );
|
named_group ) );
|
||||||
ssl->handshake->selected_group = named_group;
|
ssl->handshake->hrr_selected_group = named_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
@ -220,20 +220,22 @@ static int ssl_tls13_parse_key_shares_ext( mbedtls_ssl_context *ssl,
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const mbedtls_ecp_curve_info *curve_info =
|
|
||||||
mbedtls_ecp_curve_info_from_tls_id( group );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For now, we only support ECDHE groups.
|
* For now, we only support ECDHE groups.
|
||||||
*/
|
*/
|
||||||
if( mbedtls_ssl_tls13_named_group_is_ecdhe( group ) )
|
if( mbedtls_ssl_tls13_named_group_is_ecdhe( group ) )
|
||||||
{
|
{
|
||||||
match_found = 1;
|
const mbedtls_ecp_curve_info *curve_info =
|
||||||
|
mbedtls_ecp_curve_info_from_tls_id( group );
|
||||||
|
((void) curve_info);
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDH curve: %s", curve_info->name ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDH curve: %s", curve_info->name ) );
|
||||||
ret = mbedtls_ssl_tls13_read_public_ecdhe_share(
|
ret = mbedtls_ssl_tls13_read_public_ecdhe_share(
|
||||||
ssl, p - 2, key_exchange_len + 2 );
|
ssl, p - 2, key_exchange_len + 2 );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
match_found = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user