summaryrefslogtreecommitdiffhomepage
path: root/packet.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-06-11 21:39:40 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-06-11 21:39:40 +0800
commit723ec19eedd2618cd850e703519fd8432c67e44c (patch)
treefc53120be94eba3a2d1422c719ec7f60d3b7ab0b /packet.c
parent937e6cb91e3b0400fc516893862de74a2440501c (diff)
fix checkmac always failing pre-kex
--HG-- branch : fuzz
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index a02cb1b..63c813b 100644
--- a/packet.c
+++ b/packet.c
@@ -372,9 +372,10 @@ static int checkmac() {
#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;