Adding ifdefs to avoid warnings for unused globals

This commit is contained in:
Philippe Antoine 2019-06-25 21:53:12 +02:00
parent cd2c127f75
commit adc23e6132
4 changed files with 10 additions and 3 deletions

View File

@ -9,6 +9,7 @@
#include <stdint.h> #include <stdint.h>
#ifdef MBEDTLS_SSL_CLI_C
static bool initialized = 0; static bool initialized = 0;
#if defined(MBEDTLS_X509_CRT_PARSE_C) #if defined(MBEDTLS_X509_CRT_PARSE_C)
static mbedtls_x509_crt cacert; static mbedtls_x509_crt cacert;
@ -25,6 +26,7 @@ const char psk_id[] = "Client_identity";
#endif #endif
const char *pers = "fuzz_client"; const char *pers = "fuzz_client";
#endif //MBEDTLS_SSL_CLI_C
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

View File

@ -11,14 +11,15 @@
#include "mbedtls/timing.h" #include "mbedtls/timing.h"
#ifdef MBEDTLS_SSL_CLI_C
static bool initialized = 0; static bool initialized = 0;
#if defined(MBEDTLS_X509_CRT_PARSE_C) #if defined(MBEDTLS_X509_CRT_PARSE_C)
static mbedtls_x509_crt cacert; static mbedtls_x509_crt cacert;
#endif #endif
const char *pers = "fuzz_dtlsclient"; const char *pers = "fuzz_dtlsclient";
#endif #endif // MBEDTLS_SSL_CLI_C
#endif // MBEDTLS_SSL_PROTO_DTLS

View File

@ -12,6 +12,7 @@
#include "mbedtls/ssl_cookie.h" #include "mbedtls/ssl_cookie.h"
#ifdef MBEDTLS_SSL_SRV_C
const char *pers = "fuzz_dtlsserver"; const char *pers = "fuzz_dtlsserver";
const unsigned char client_ip[4] = {0x7F, 0, 0, 1}; const unsigned char client_ip[4] = {0x7F, 0, 0, 1};
static bool initialized = 0; static bool initialized = 0;
@ -19,7 +20,8 @@ static bool initialized = 0;
static mbedtls_x509_crt srvcert; static mbedtls_x509_crt srvcert;
static mbedtls_pk_context pkey; static mbedtls_pk_context pkey;
#endif #endif
#endif #endif // MBEDTLS_SSL_SRV_C
#endif // MBEDTLS_SSL_PROTO_DTLS
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 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)

View File

@ -10,6 +10,7 @@
#include <stdint.h> #include <stdint.h>
#ifdef MBEDTLS_SSL_SRV_C
const char *pers = "fuzz_server"; const char *pers = "fuzz_server";
static bool initialized = 0; static bool initialized = 0;
#if defined(MBEDTLS_X509_CRT_PARSE_C) #if defined(MBEDTLS_X509_CRT_PARSE_C)
@ -25,6 +26,7 @@ const unsigned char psk[] = {
}; };
const char psk_id[] = "Client_identity"; const char psk_id[] = "Client_identity";
#endif #endif
#endif // MBEDTLS_SSL_SRV_C
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {