mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Use mbedtls_test_read_mpi in test suites
Replace calls to mbedtls_mpi_read_string() with a wrapper mbedtls_test_read_mpi() when reading test data except for the purpose of testing mbedtls_mpi_read_string() itself. The wrapper lets the test data control precisely how many limbs the constructed MPI has. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -417,7 +417,7 @@ void get_integer( const data_t *input,
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_BIGNUM_C)
|
||||
ret = mbedtls_mpi_read_string( &expected_mpi, 16, expected_hex );
|
||||
ret = mbedtls_test_read_mpi( &expected_mpi, 16, expected_hex );
|
||||
TEST_ASSERT( ret == 0 || ret == MBEDTLS_ERR_MPI_BAD_INPUT_DATA );
|
||||
if( ret == MBEDTLS_ERR_MPI_BAD_INPUT_DATA )
|
||||
{
|
||||
|
Reference in New Issue
Block a user