changeset 1561:02b226c2675e fuzz

clean some fuzzing conditionals
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Feb 2018 22:10:43 +0800
parents 92c93b4a3646
children 768ebf737aa0
files dbrandom.c fuzz.h svr-auth.c
diffstat 3 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/dbrandom.c	Wed Feb 28 22:02:12 2018 +0800
+++ b/dbrandom.c	Wed Feb 28 22:10:43 2018 +0800
@@ -146,7 +146,7 @@
 	hash_state hs;
 
 #if DROPBEAR_FUZZ
-	if (fuzz.fuzzing || fuzz.recordf) {
+	if (fuzz.fuzzing) {
 		return;
 	}
 #endif
@@ -164,7 +164,7 @@
 static void write_urandom()
 {
 #if DROPBEAR_FUZZ
-	if (fuzz.fuzzing || fuzz.recordf) {
+	if (fuzz.fuzzing) {
 		return;
 	}
 #endif
@@ -204,7 +204,7 @@
 	clock_t clockval;
 
 #if DROPBEAR_FUZZ
-	if (fuzz.fuzzing || fuzz.recordf) {
+	if (fuzz.fuzzing) {
 		return;
 	}
 #endif
--- a/fuzz.h	Wed Feb 28 22:02:12 2018 +0800
+++ b/fuzz.h	Wed Feb 28 22:10:43 2018 +0800
@@ -43,9 +43,6 @@
 struct dropbear_fuzz_options {
     int fuzzing;
 
-    // to record an unencrypted stream
-    FILE* recordf;
-
     // fuzzing input
     buffer *input;
     struct dropbear_cipher recv_cipher;
--- a/svr-auth.c	Wed Feb 28 22:02:12 2018 +0800
+++ b/svr-auth.c	Wed Feb 28 22:10:43 2018 +0800
@@ -396,12 +396,11 @@
 		/* We delay for 300ms +- 50ms */
 		delay = 250000 + (delay % 100000);
 #if DROPBEAR_FUZZ
-		if (!fuzz.fuzzing) {
+		if (!fuzz.fuzzing)
+#endif
+		{
 			usleep(delay);
 		}
-#else
-		usleep(delay);
-#endif
 		ses.authstate.failcount++;
 	}