Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Wunused-but-set-variable warning/error #373

Open
wants to merge 1 commit into
base: tls13-prototype
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/ssl_tls13_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,10 @@ int mbedtls_ssl_tls1_3_generate_resumption_master_secret(
int ret = 0;

mbedtls_md_type_t md_type;
#if defined(MBEDTLS_DEBUG_C)
mbedtls_md_info_t const *md_info;
size_t md_size;
#endif /* MBEDTLS_DEBUG_C */

unsigned char transcript[MBEDTLS_MD_MAX_SIZE];
size_t transcript_len;
Expand All @@ -896,8 +898,10 @@ int mbedtls_ssl_tls1_3_generate_resumption_master_secret(
( "=> mbedtls_ssl_tls1_3_generate_resumption_master_secret" ) );

md_type = ssl->handshake->ciphersuite_info->mac;
#if defined(MBEDTLS_DEBUG_C)
md_info = mbedtls_md_info_from_type( md_type );
md_size = mbedtls_md_get_size( md_info );
#endif /* MBEDTLS_DEBUG_C */

ret = mbedtls_ssl_get_handshake_transcript( ssl, md_type,
transcript, sizeof( transcript ),
Expand Down
4 changes: 4 additions & 0 deletions library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ static int ssl_parse_key_shares_ext( mbedtls_ssl_context *ssl,
{
uint16_t their_group;
mbedtls_ecp_group_id their_curve;
#if defined(MBEDTLS_DEBUG_C)
mbedtls_ecp_curve_info const *their_curve_info;
#endif /* MBEDTLS_DEBUG_C */
unsigned char const *end_of_share;

/*
Expand Down Expand Up @@ -439,7 +441,9 @@ static int ssl_parse_key_shares_ext( mbedtls_ssl_context *ssl,
* - Apply further curve checks
*/

#if defined(MBEDTLS_DEBUG_C)
their_curve_info = mbedtls_ecp_curve_info_from_grp_id( their_curve );
#endif /* MBEDTLS_DEBUG_C */
MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDH curve: %s", their_curve_info->name ) );

ret = mbedtls_ecdh_setup( &ssl->handshake->ecdh_ctx, their_curve );
Expand Down