From: Kurt Roeckx Date: Tue, 14 Feb 2017 23:36:46 +0000 (+0100) Subject: Use memcmp() instead of CRYPTO_memcmp() when fuzzing X-Git-Tag: OpenSSL_1_1_1-pre1~1987 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=43c564170c7300092fa1627b961480c708d6fc01 Use memcmp() instead of CRYPTO_memcmp() when fuzzing Reviewed-by: Andy Polyakov GH: #2633 --- diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 71a5c35974..3151e1a884 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -321,6 +321,7 @@ void OPENSSL_die(const char *message, const char *file, int line) * * There are also assembler versions of this function. */ +# undef CRYPTO_memcmp int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len) { size_t i; diff --git a/e_os.h b/e_os.h index eafa8623aa..d2f4d3ff28 100644 --- a/e_os.h +++ b/e_os.h @@ -513,6 +513,10 @@ struct servent *getservbyname(const char *name, const char *proto); #define OSSL_NELEM(x) (sizeof(x)/sizeof(x[0])) +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +# define CRYPTO_memcmp memcmp +#endif + #ifdef __cplusplus } #endif