mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 13:25:28 +00:00
Merge pull request #4123 from gilles-peskine-arm/fix-build-test_generate_random
Remove trail check in the generate_random test
This commit is contained in:
commit
6b8d0a48eb
|
@ -5543,7 +5543,6 @@ exit:
|
|||
void generate_random( int bytes_arg )
|
||||
{
|
||||
size_t bytes = bytes_arg;
|
||||
const unsigned char trail[] = "don't overwrite me";
|
||||
unsigned char *output = NULL;
|
||||
unsigned char *changed = NULL;
|
||||
size_t i;
|
||||
|
@ -5551,9 +5550,8 @@ void generate_random( int bytes_arg )
|
|||
|
||||
TEST_ASSERT( bytes_arg >= 0 );
|
||||
|
||||
ASSERT_ALLOC( output, bytes + sizeof( trail ) );
|
||||
ASSERT_ALLOC( output, bytes );
|
||||
ASSERT_ALLOC( changed, bytes );
|
||||
memcpy( output + bytes, trail, sizeof( trail ) );
|
||||
|
||||
PSA_ASSERT( psa_crypto_init( ) );
|
||||
|
||||
|
@ -5566,10 +5564,6 @@ void generate_random( int bytes_arg )
|
|||
memset( output, 0, bytes );
|
||||
PSA_ASSERT( psa_generate_random( output, bytes ) );
|
||||
|
||||
/* Check that no more than bytes have been overwritten */
|
||||
ASSERT_COMPARE( output + bytes, sizeof( trail ),
|
||||
trail, sizeof( trail ) );
|
||||
|
||||
for( i = 0; i < bytes; i++ )
|
||||
{
|
||||
if( output[i] != 0 )
|
||||
|
|
Loading…
Reference in a new issue