mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Adapt programs / test suites
This commit is contained in:
parent
8f870b047c
commit
a317a98221
33 changed files with 76 additions and 12 deletions
|
|
@ -48,7 +48,7 @@ int main( int argc, char *argv[] )
|
|||
{
|
||||
FILE *f;
|
||||
time_t t;
|
||||
int i, k;
|
||||
int i, k, ret = 0;
|
||||
havege_state hs;
|
||||
unsigned char buf[1024];
|
||||
|
||||
|
|
@ -73,8 +73,9 @@ int main( int argc, char *argv[] )
|
|||
if( havege_random( &hs, buf, sizeof( buf ) ) != 0 )
|
||||
{
|
||||
printf( "Failed to get random from source.\n" );
|
||||
fclose( f );
|
||||
return( 1 );
|
||||
|
||||
ret = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
fwrite( buf, sizeof( buf ), 1, f );
|
||||
|
|
@ -89,7 +90,9 @@ int main( int argc, char *argv[] )
|
|||
|
||||
printf(" \n ");
|
||||
|
||||
exit:
|
||||
havege_free( &hs );
|
||||
fclose( f );
|
||||
return( 0 );
|
||||
return( ret );
|
||||
}
|
||||
#endif /* POLARSSL_HAVEGE_C */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue