Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #2023
# include <openssl/fips.h>
#endif
-#ifdef BN_DEBUG
+#if defined(BN_DEBUG) || defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
# define PREDICT
#endif
#ifdef PREDICT
if (rand_predictable) {
- static unsigned char val = 0;
+ unsigned char val = 0;
for (i = 0; i < num; i++)
buf[i] = val++;
$ CC=clang ./config enable-fuzz-libfuzzer \
--with-fuzzer-include=../../svn-work/Fuzzer \
--with-fuzzer-lib=../../svn-work/Fuzzer/libFuzzer \
- -DPEDANTIC enable-asan enable-ubsan no-shared
+ -DPEDANTIC enable-asan enable-ubsan no-shared \
+ -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
$ sudo apt-get install make
$ LDCMD=clang++ make -j
$ fuzz/helper.py $FUZZER
static SSL_CTX *ctx;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+extern int rand_predictable;
+#endif
+
int FuzzerInitialize(int *argc, char ***argv)
{
const uint8_t *bufp = kRSAPrivateKeyDER;
OPENSSL_assert(ret == 1);
X509_free(cert);
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ rand_predictable = 1;
+#endif
+
return 1;
}