Add a concept of entropy source strength.

The main goal is, we want and error if cycle counter is the only source.
This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-19 10:26:32 +02:00
parent 3f77dfbd52
commit 7580ba475d
5 changed files with 47 additions and 19 deletions

View file

@ -286,7 +286,8 @@ int main( int argc, char *argv[] )
if( opt.use_dev_random )
{
if( ( ret = mbedtls_entropy_add_source( &entropy, dev_random_entropy_poll,
NULL, DEV_RANDOM_THRESHOLD ) ) != 0 )
NULL, DEV_RANDOM_THRESHOLD,
MBEDTLS_ENTROPY_SOURCE_STRONG ) ) != 0 )
{
mbedtls_printf( " failed\n ! mbedtls_entropy_add_source returned -0x%04x\n", -ret );
goto exit;