mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Rework mbedtls_test_unhexify()
Rework mbedtls_test_unhexify to extend its scope of usage. Return in error when the function detects an error instead of calling mbedtls_exit(). Improve safety by checking the output buffer is not overrun. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -277,8 +277,13 @@ static int convert_params( size_t cnt , char ** params , int * int_params_store
|
||||
{
|
||||
if ( verify_string( &val ) == 0 )
|
||||
{
|
||||
*int_params_store = mbedtls_test_unhexify(
|
||||
(unsigned char *) val, val );
|
||||
size_t len;
|
||||
|
||||
TEST_HELPER_ASSERT(
|
||||
mbedtls_test_unhexify( (unsigned char *) val, strlen( val ),
|
||||
val, &len ) == 0 );
|
||||
|
||||
*int_params_store = len;
|
||||
*out++ = val;
|
||||
*out++ = (char *)(int_params_store++);
|
||||
}
|
||||
|
Reference in New Issue
Block a user