Rename the 'no entropy' feature to MBEDTLS_TEST_NULL_ENTROPY

Following review and for clarity, changed the name of the feature to 'null
entropy'.
This commit is contained in:
Simon Butcher 2016-06-11 02:31:21 +01:00
parent 72ff973d22
commit ab5df40054
8 changed files with 35 additions and 37 deletions

View file

@ -27,6 +27,12 @@
#if defined(MBEDTLS_ENTROPY_C)
#if defined(MBEDTLS_TEST_NULL_ENTROPY)
#warning "**** WARNING! MBEDTLS_TEST_NULL_ENTROPY defined! ****"
#warning "**** THIS BUILD HAS NO DEFINED ENTROPY SOURCES ****"
#warning "**** NOT SUITABLE FOR PRODUCTION ****"
#endif
#include "mbedtls/entropy.h"
#include "mbedtls/entropy_poll.h"
@ -73,7 +79,7 @@ void mbedtls_entropy_init( mbedtls_entropy_context *ctx )
mbedtls_havege_init( &ctx->havege_data );
#endif
#if defined(MBEDTLS_TEST_WO_ENTROPY)
#if defined(MBEDTLS_TEST_NULL_ENTROPY)
mbedtls_entropy_add_source( ctx, mbedtls_zero_entropy_poll, NULL,
1, MBEDTLS_ENTROPY_SOURCE_STRONG );
#endif

View file

@ -191,11 +191,12 @@ int mbedtls_platform_entropy_poll( void *data,
#endif /* _WIN32 && !EFIX64 && !EFI32 */
#endif /* !MBEDTLS_NO_PLATFORM_ENTROPY */
#if defined(MBEDTLS_TEST_WO_ENTROPY)
#if defined(MBEDTLS_TEST_NULL_ENTROPY)
int mbedtls_zero_entropy_poll( void *data,
unsigned char *output, size_t len, size_t *olen )
{
((void) data);
((void) output);
*olen = 0;
if( len < sizeof(unsigned char) )

View file

@ -159,9 +159,9 @@ static const char *features[] = {
#if defined(MBEDTLS_AES_DECRYPT_ALT)
"MBEDTLS_AES_DECRYPT_ALT",
#endif /* MBEDTLS_AES_DECRYPT_ALT */
#if defined(MBEDTLS_TEST_WO_ENTROPY)
"MBEDTLS_TEST_WO_ENTROPY",
#endif /* MBEDTLS_TEST_WO_ENTROPY */
#if defined(MBEDTLS_TEST_NULL_ENTROPY)
"MBEDTLS_TEST_NULL_ENTROPY",
#endif /* MBEDTLS_TEST_NULL_ENTROPY */
#if defined(MBEDTLS_ENTROPY_NV_SEED)
"MBEDTLS_ENTROPY_NV_SEED",
#endif /* MBEDTLS_ENTROPY_NV_SEED */