Protecting client/server fuzz targts with ifdefs

This commit is contained in:
Philippe Antoine 2019-06-06 09:12:53 +02:00
parent 03e87d909d
commit c32fd248e3
4 changed files with 14 additions and 2 deletions

View file

@ -28,6 +28,7 @@ const char *pers = "fuzz_client";
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#ifdef MBEDTLS_SSL_CLI_C
int ret;
size_t len;
mbedtls_ssl_context ssl;
@ -162,5 +163,10 @@ exit:
mbedtls_ssl_config_free( &conf );
mbedtls_ssl_free( &ssl );
#else
(void) Data;
(void) Size;
#endif //MBEDTLS_SSL_CLI_C
return 0;
}

View file

@ -23,7 +23,7 @@ const char *pers = "fuzz_dtlsclient";
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#if defined(MBEDTLS_SSL_PROTO_DTLS)
#if defined(MBEDTLS_SSL_PROTO_DTLS) && defined(MBEDTLS_SSL_CLI_C)
int ret;
size_t len;
mbedtls_ssl_context ssl;

View file

@ -22,7 +22,7 @@ static mbedtls_pk_context pkey;
#endif
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#if defined(MBEDTLS_SSL_PROTO_DTLS)
#if defined(MBEDTLS_SSL_PROTO_DTLS) && defined(MBEDTLS_SSL_SRV_C)
int ret;
size_t len;
mbedtls_ssl_context ssl;

View file

@ -28,6 +28,7 @@ const char psk_id[] = "Client_identity";
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
#ifdef MBEDTLS_SSL_SRV_C
int ret;
size_t len;
mbedtls_ssl_context ssl;
@ -174,5 +175,10 @@ exit:
mbedtls_ssl_config_free( &conf );
mbedtls_ssl_free( &ssl );
#else
(void) Data;
(void) Size;
#endif //MBEDTLS_SSL_SRV_C
return 0;
}