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

- Debug print of MPI now removes leading zero octets and displays actual bit size of the value

This commit is contained in:
Paul Bakker
2011-03-14 20:41:31 +00:00
parent b3dcbc18f6
commit be4e7dca08
4 changed files with 95 additions and 15 deletions

View File

@@ -37,3 +37,27 @@ debug_print_crt:crt_file:file:line:prefix:result_str
TEST_ASSERT( strcmp( buffer.buf, {result_str} ) == 0 );
}
END_CASE
BEGIN_CASE
debug_print_mpi:radix:value:file:line:prefix:result_str
{
ssl_context ssl;
struct buffer_data buffer;
mpi val;
mpi_init( &val, NULL );
memset( &ssl, 0, sizeof( ssl_context ) );
memset( buffer.buf, 0, 2000 );
buffer.ptr = buffer.buf;
TEST_ASSERT( mpi_read_string( &val, {radix}, {value} ) == 0 );
ssl_set_dbg(&ssl, string_debug, &buffer);
debug_print_mpi( &ssl, 0, {file}, {line}, {prefix}, &val);
TEST_ASSERT( strcmp( buffer.buf, {result_str} ) == 0 );
}
END_CASE