mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-05-13 13:52:15 +00:00
Add internal macro ENTROPY_HAVE_DEFAULT indicating default entropy
This commit adds the macro ENTROPY_HAVE_DEFAULT to the helper test file tests/suites/helpers.function to be able to make tests depend on the presence of a default entropy source.
This commit is contained in:
parent
cffe2daf25
commit
adb9bd23d9
|
@ -61,6 +61,9 @@ void entropy_init( entropy_context *ctx )
|
||||||
{
|
{
|
||||||
memset( ctx, 0, sizeof(entropy_context) );
|
memset( ctx, 0, sizeof(entropy_context) );
|
||||||
|
|
||||||
|
/* Reminder: Update ENTROPY_HAVE_DEFAULT in the test files
|
||||||
|
* when adding more strong entropy sources here. */
|
||||||
|
|
||||||
#if defined(POLARSSL_THREADING_C)
|
#if defined(POLARSSL_THREADING_C)
|
||||||
polarssl_mutex_init( &ctx->mutex );
|
polarssl_mutex_init( &ctx->mutex );
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,6 +53,17 @@ typedef UINT32 uint32_t;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Helper flags for complex dependencies */
|
||||||
|
|
||||||
|
/* Indicates whether we expect mbedtls_entropy_init
|
||||||
|
* to initialize some strong entropy source. */
|
||||||
|
#if !defined(POLARSSL_NO_DEFAULT_ENTROPY_SOURCES) && \
|
||||||
|
( !defined(POLARSSL_NO_PLATFORM_ENTROPY) || \
|
||||||
|
defined(POLARSSL_HAVEGE_C) || \
|
||||||
|
defined(POLARSSL_TIMING_C) )
|
||||||
|
#define ENTROPY_HAVE_DEFAULT
|
||||||
|
#endif
|
||||||
|
|
||||||
static int unhexify( unsigned char *obuf, const char *ibuf )
|
static int unhexify( unsigned char *obuf, const char *ibuf )
|
||||||
{
|
{
|
||||||
unsigned char c, c2;
|
unsigned char c, c2;
|
||||||
|
@ -212,7 +223,7 @@ typedef struct
|
||||||
* This function returns random based on a buffer it receives.
|
* This function returns random based on a buffer it receives.
|
||||||
*
|
*
|
||||||
* rng_state shall be a pointer to a rnd_buf_info structure.
|
* rng_state shall be a pointer to a rnd_buf_info structure.
|
||||||
*
|
*
|
||||||
* The number of bytes released from the buffer on each call to
|
* The number of bytes released from the buffer on each call to
|
||||||
* the random function is specified by per_call. (Can be between
|
* the random function is specified by per_call. (Can be between
|
||||||
* 1 and 4)
|
* 1 and 4)
|
||||||
|
|
Loading…
Reference in a new issue