mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 22:15:43 +01:00
Initialize hash_len before using it
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d61551c017
commit
622d80453b
@ -3631,6 +3631,14 @@ int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl )
|
||||
|
||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse finished" ) );
|
||||
|
||||
/* There is currently no ciphersuite using another length with TLS 1.2 */
|
||||
#if defined(MBEDTLS_SSL_PROTO_SSL3)
|
||||
if( ssl->minor_ver == MBEDTLS_SSL_MINOR_VERSION_0 )
|
||||
hash_len = 36;
|
||||
else
|
||||
#endif
|
||||
hash_len = 12;
|
||||
|
||||
ssl->handshake->calc_finished( ssl, buf, ssl->conf->endpoint ^ 1 );
|
||||
|
||||
if( ( ret = mbedtls_ssl_read_record( ssl, 1 ) ) != 0 )
|
||||
@ -3648,14 +3656,6 @@ int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl )
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* There is currently no ciphersuite using another length with TLS 1.2 */
|
||||
#if defined(MBEDTLS_SSL_PROTO_SSL3)
|
||||
if( ssl->minor_ver == MBEDTLS_SSL_MINOR_VERSION_0 )
|
||||
hash_len = 36;
|
||||
else
|
||||
#endif
|
||||
hash_len = 12;
|
||||
|
||||
if( ssl->in_msg[0] != MBEDTLS_SSL_HS_FINISHED ||
|
||||
ssl->in_hslen != mbedtls_ssl_hs_hdr_len( ssl ) + hash_len )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user