1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +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

@@ -11,7 +11,10 @@
#include "mbedtls/ssl_cookie.h"
#ifdef MBEDTLS_SSL_SRV_C
#if defined(MBEDTLS_SSL_SRV_C) && \
defined(MBEDTLS_ENTROPY_C) && \
defined(MBEDTLS_CTR_DRBG_C) && \
defined(MBEDTLS_TIMING_C)
const char *pers = "fuzz_dtlsserver";
const unsigned char client_ip[4] = {0x7F, 0, 0, 1};
static int initialized = 0;
@@ -19,11 +22,15 @@ static int initialized = 0;
static mbedtls_x509_crt srvcert;
static mbedtls_pk_context pkey;
#endif
#endif // MBEDTLS_SSL_SRV_C
#endif
#endif // MBEDTLS_SSL_PROTO_DTLS
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#if defined(MBEDTLS_SSL_PROTO_DTLS) && defined(MBEDTLS_SSL_SRV_C)
#if defined(MBEDTLS_SSL_PROTO_DTLS) && \
defined(MBEDTLS_SSL_SRV_C) && \
defined(MBEDTLS_ENTROPY_C) && \
defined(MBEDTLS_CTR_DRBG_C) && \
defined(MBEDTLS_TIMING_C)
int ret;
size_t len;
mbedtls_ssl_context ssl;