Improve entropy selftest: check default sources
This commit is contained in:
parent
151dc77732
commit
e94bfe6cd6
1 changed files with 4 additions and 3 deletions
|
@ -421,11 +421,12 @@ int mbedtls_entropy_self_test( int verbose )
|
||||||
|
|
||||||
mbedtls_entropy_init( &ctx );
|
mbedtls_entropy_init( &ctx );
|
||||||
|
|
||||||
ret = mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 );
|
/* First do a gather to mek sure we have default sources */
|
||||||
if( ret != 0 )
|
if( ( ret = mbedtls_entropy_gather( &ctx ) ) != 0 )
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if( ( ret = mbedtls_entropy_gather( &ctx ) ) != 0 )
|
ret = mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 );
|
||||||
|
if( ret != 0 )
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if( ( ret = mbedtls_entropy_update_manual( &ctx, buf, sizeof buf ) ) != 0 )
|
if( ( ret = mbedtls_entropy_update_manual( &ctx, buf, sizeof buf ) ) != 0 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue