1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-07 06:42:56 +03:00

Let the allocated memory visible for the memory sanitizer

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei
2022-10-20 12:27:36 +02:00
parent 7ba7b3aded
commit a8cf998bc9
2 changed files with 27 additions and 0 deletions

View File

@@ -147,6 +147,9 @@ void mpi_mod_raw_cond_assign( char * input_X,
mbedtls_mpi_mod_raw_cond_assign( X, Y, &m, 0 );
TEST_CF_PUBLIC( X, bytes );
TEST_CF_PUBLIC( Y, bytes );
TEST_ASSERT( memcmp( X, Y, bytes ) != 0 );
/* condition is true */
@@ -155,6 +158,9 @@ void mpi_mod_raw_cond_assign( char * input_X,
mbedtls_mpi_mod_raw_cond_assign( X, Y, &m, 1 );
TEST_CF_PUBLIC( X, bytes );
TEST_CF_PUBLIC( Y, bytes );
/* Check if the given length is copied even it is smaller
than the length of the given MPIs. */
if( copy_limbs <limbs )
@@ -220,6 +226,9 @@ void mpi_mod_raw_cond_swap( char * input_X,
mbedtls_mpi_mod_raw_cond_swap( X, Y, &m, 0 );
TEST_CF_PUBLIC( X, bytes );
TEST_CF_PUBLIC( Y, bytes );
ASSERT_COMPARE( X, bytes, tmp_X, bytes );
ASSERT_COMPARE( Y, bytes, tmp_Y, bytes );
@@ -229,6 +238,9 @@ void mpi_mod_raw_cond_swap( char * input_X,
mbedtls_mpi_mod_raw_cond_swap( X, Y, &m, 1 );
TEST_CF_PUBLIC( X, bytes );
TEST_CF_PUBLIC( Y, bytes );
/* Check if the given length is copied even it is smaller
than the length of the given MPIs. */
if( copy_limbs < limbs )