1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Fix undeclared deps on CTR_DRBG in programs/fuzz

While at it, fix a few other obvious ones such as ENTROPY and TIMING_C when
applicable.

A non-regression test for CTR_DRBG will be added in a follow-up commit.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard
2020-05-20 10:35:01 +02:00
parent d12402ffc0
commit a89040c7f5
5 changed files with 41 additions and 14 deletions

View File

@ -58,8 +58,13 @@ int dummy_random( void *p_rng, unsigned char *output, size_t output_len )
int ret;
size_t i;
#if defined(MBEDTLS_CTR_DRBG_C)
//use mbedtls_ctr_drbg_random to find bugs in it
ret = mbedtls_ctr_drbg_random(p_rng, output, output_len);
#else
(void) p_rng;
ret = 0;
#endif
for (i=0; i<output_len; i++) {
//replace result with pseudo random
output[i] = (unsigned char) rand();