aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-06-16 01:29:07 +0200
committerhexcoder- <heiko@hexco.de>2020-06-16 01:29:07 +0200
commitbac2da866912d69eb89207757375f0753be2cae2 (patch)
tree9f1a710a6282d4cf4cb9752024c3040eaf40b869 /include
parent9c293b5b7b941d8046e77989f100d084a516d029 (diff)
downloadafl++-bac2da866912d69eb89207757375f0753be2cae2.tar.gz
fix for *BSD: remove all HAVE_ARC4RANDOM dependencies
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h9
-rw-r--r--include/config.h6
-rw-r--r--include/forkserver.h3
3 files changed, 1 insertions, 17 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index e86bc0ff..e7b52d56 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -524,9 +524,7 @@ typedef struct afl_state {
u64 stage_finds[32], /* Patterns found per fuzz stage */
stage_cycles[32]; /* Execs per fuzz stage */
- //#ifndef HAVE_ARC4RANDOM
u32 rand_cnt; /* Random number counter */
- //#endif
u64 rand_seed[4];
s64 init_seed;
@@ -958,13 +956,8 @@ uint64_t rand_next(afl_state_t *afl);
static inline u32 rand_below(afl_state_t *afl, u32 limit) {
- //#ifdef HAVE_ARC4RANDOM
- // if (unlikely(afl->fixed_seed)) { return random() % limit; }
-
/* The boundary not being necessarily a power of 2,
we need to ensure the result uniformity. */
- // return arc4random_uniform(limit);
- //#else
if (unlikely(!afl->rand_cnt--) && likely(!afl->fixed_seed)) {
ck_read(afl->fsrv.dev_urandom_fd, &afl->rand_seed, sizeof(afl->rand_seed),
@@ -974,9 +967,7 @@ static inline u32 rand_below(afl_state_t *afl, u32 limit) {
}
- // return random() % limit;
return rand_next(afl) % limit;
- //#endif
}
diff --git a/include/config.h b/include/config.h
index b93a9f9e..711d0b77 100644
--- a/include/config.h
+++ b/include/config.h
@@ -397,12 +397,6 @@
// #define IGNORE_FINDS
-/* for *BSD: use ARC4RANDOM and save a file descriptor */
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
- #ifndef HAVE_ARC4RANDOM
- #define HAVE_ARC4RANDOM 1
- #endif
-#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
#endif /* ! _HAVE_CONFIG_H */
diff --git a/include/forkserver.h b/include/forkserver.h
index 87a59eaa..717493db 100644
--- a/include/forkserver.h
+++ b/include/forkserver.h
@@ -47,9 +47,8 @@ typedef struct afl_forkserver {
out_dir_fd; /* FD of the lock file */
s32 out_fd, /* Persistent fd for fsrv->out_file */
-#ifndef HAVE_ARC4RANDOM
dev_urandom_fd, /* Persistent fd for /dev/urandom */
-#endif
+
dev_null_fd, /* Persistent fd for /dev/null */
fsrv_ctl_fd, /* Fork server control pipe (write) */
fsrv_st_fd; /* Fork server status pipe (read) */