changeset 1408:27e65d3aed5f fuzz

fix checkmac always failing pre-kex
author Matt Johnston <matt@ucc.asn.au>
date Sun, 11 Jun 2017 21:39:40 +0800
parents f0990c284663
children 798854f62430
files packet.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packet.c	Fri Jun 02 00:03:51 2017 +0800
+++ b/packet.c	Sun Jun 11 21:39:40 2017 +0800
@@ -372,9 +372,10 @@
 
 #ifdef DROPBEAR_FUZZ
 	if (fuzz.fuzzing) {
-		// fail 1 in 1000 times to test error path
+		// 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 % 1000 == 0) {
+		if (value % 2000 == 99) {
 			return DROPBEAR_FAILURE;
 		}
 		return DROPBEAR_SUCCESS;