mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Disable debug messages that can introduce a timing side channel.
Introduced the POLARSSL_SSL_DEBUG_ALL flag to enable all these debug messages in case somebody does want to see the reason checks fail.
This commit is contained in:
@ -1403,9 +1403,10 @@ static int ssl_decrypt_buf( ssl_context *ssl )
|
||||
|
||||
if( ssl->in_msglen < ssl->transform_in->maclen + padlen )
|
||||
{
|
||||
#if defined(POLARSSL_SSL_DEBUG_ALL)
|
||||
SSL_DEBUG_MSG( 1, ( "msglen (%d) < maclen (%d) + padlen (%d)",
|
||||
ssl->in_msglen, ssl->transform_in->maclen, padlen ) );
|
||||
|
||||
#endif
|
||||
padlen = 0;
|
||||
fake_padlen = 256;
|
||||
correct = 0;
|
||||
@ -1415,9 +1416,11 @@ static int ssl_decrypt_buf( ssl_context *ssl )
|
||||
{
|
||||
if( padlen > ssl->transform_in->ivlen )
|
||||
{
|
||||
#if defined(POLARSSL_SSL_DEBUG_ALL)
|
||||
SSL_DEBUG_MSG( 1, ( "bad padding length: is %d, "
|
||||
"should be no more than %d",
|
||||
padlen, ssl->transform_in->ivlen ) );
|
||||
#endif
|
||||
correct = 0;
|
||||
}
|
||||
}
|
||||
@ -1443,8 +1446,10 @@ static int ssl_decrypt_buf( ssl_context *ssl )
|
||||
else
|
||||
minlen = 1;
|
||||
}
|
||||
#if defined(POLARSSL_SSL_DEBUG_ALL)
|
||||
if( padlen > 0 && correct == 0)
|
||||
SSL_DEBUG_MSG( 1, ( "bad padding byte detected" ) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user