1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Add explicit counter in DTLS record header

This commit is contained in:
Manuel Pégourié-Gonnard
2014-02-14 08:39:32 +01:00
committed by Paul Bakker
parent 507e1e410a
commit 0619348288
3 changed files with 86 additions and 52 deletions

View File

@ -1134,7 +1134,7 @@ static int ssl_parse_client_hello( ssl_context *ssl )
SSL_DEBUG_MSG( 2, ( "=> parse client hello" ) );
if( ssl->renegotiation == SSL_INITIAL_HANDSHAKE &&
( ret = ssl_fetch_input( ssl, 5 ) ) != 0 )
( ret = ssl_fetch_input( ssl, ssl_hdr_len( ssl ) ) ) != 0 )
{
SSL_DEBUG_RET( 1, "ssl_fetch_input", ret );
return( ret );
@ -1147,7 +1147,7 @@ static int ssl_parse_client_hello( ssl_context *ssl )
return ssl_parse_client_hello_v2( ssl );
#endif
SSL_DEBUG_BUF( 4, "record header", buf, 5 ); // TODO: 13 for DTLS
SSL_DEBUG_BUF( 4, "record header", buf, ssl_hdr_len( ssl ) );
SSL_DEBUG_MSG( 3, ( "client hello v3, message type: %d",
buf[0] ) );
@ -1191,7 +1191,7 @@ static int ssl_parse_client_hello( ssl_context *ssl )
}
if( ssl->renegotiation == SSL_INITIAL_HANDSHAKE &&
( ret = ssl_fetch_input( ssl, 5 + n ) ) != 0 )
( ret = ssl_fetch_input( ssl, ssl_hdr_len( ssl ) + n ) ) != 0 )
{
SSL_DEBUG_RET( 1, "ssl_fetch_input", ret );
return( ret );
@ -1199,7 +1199,7 @@ static int ssl_parse_client_hello( ssl_context *ssl )
buf = ssl->in_msg;
if( !ssl->renegotiation )
n = ssl->in_left - 5;
n = ssl->in_left - ssl_hdr_len( ssl );
else
n = ssl->in_msglen;