Fix to be able to compile normal(ish) binaries with --enable-fuzz

--HG--
branch : fuzz
This commit is contained in:
Matt Johnston
2018-02-28 22:02:12 +08:00
parent c658b275fd
commit 5f2447edbb
11 changed files with 49 additions and 38 deletions

View File

@@ -79,8 +79,8 @@ void write_packet() {
it's likely to be necessary */
#if DROPBEAR_FUZZ
if (fuzz.fuzzing) {
// pretend to write one packet at a time
// TODO(fuzz): randomise amount written based on the fuzz input
/* pretend to write one packet at a time */
/* TODO(fuzz): randomise amount written based on the fuzz input */
written = iov[0].iov_len;
}
else
@@ -368,8 +368,8 @@ static int checkmac() {
#if DROPBEAR_FUZZ
if (fuzz.fuzzing) {
// fail 1 in 2000 times to test error path.
// note that mac_bytes is all zero prior to kex, so don't test ==0 !
/* fail 1 in 2000 times to test error path.
note that mac_bytes is all zero prior to kex, so don't test ==0 ! */
unsigned int value = *((unsigned int*)&mac_bytes);
if (value % 2000 == 99) {
return DROPBEAR_FAILURE;