mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Documentation and entropy self test changes (#610)
Ensure that the entropy self test always fails whenever MBEDTLS_TEST_NULL_ENTROPY is defined. This is because the option is meant to be for testing and development purposes rather than production quality software. Also, this patch enhances the documentation for mbedtls_entropy_source_self_test() and mbedtls_entropy_self_test().
This commit is contained in:
parent
c0d76b8255
commit
a928e67278
2 changed files with 14 additions and 1 deletions
|
|
@ -575,7 +575,7 @@ cleanup:
|
|||
*/
|
||||
int mbedtls_entropy_self_test( int verbose )
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 1;
|
||||
mbedtls_entropy_context ctx;
|
||||
unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 };
|
||||
unsigned char acc[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 };
|
||||
|
|
@ -584,6 +584,7 @@ int mbedtls_entropy_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
mbedtls_printf( " ENTROPY test: " );
|
||||
|
||||
#if !defined(MBEDTLS_TEST_NULL_ENTROPY)
|
||||
mbedtls_entropy_init( &ctx );
|
||||
|
||||
/* First do a gather to make sure we have default sources */
|
||||
|
|
@ -631,6 +632,7 @@ int mbedtls_entropy_self_test( int verbose )
|
|||
|
||||
cleanup:
|
||||
mbedtls_entropy_free( &ctx );
|
||||
#endif /* !MBEDTLS_TEST_NULL_ENTROPY */
|
||||
|
||||
if( verbose != 0 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue