# HG changeset patch # User Matt Johnston # Date 1248624687 0 # Node ID ccdc4c6183c0f96cbba58ee1f2e754b19e34605c # Parent daf52f8133282e65f69d6f5c2ada1348a0303fe6 - Payload length doesn't include macsize. diff -r daf52f813328 -r ccdc4c6183c0 debug.h --- a/debug.h Sun Jul 26 15:39:47 2009 +0000 +++ b/debug.h Sun Jul 26 16:11:27 2009 +0000 @@ -39,7 +39,7 @@ * Caution: Don't use this in an unfriendly environment (ie unfirewalled), * since the printing may not sanitise strings etc. This will add a reasonable * amount to your executable size. */ -/*#define DEBUG_TRACE*/ +#define DEBUG_TRACE /* All functions writing to the cleartext payload buffer call * CHECKCLEARTOWRITE() before writing. This is only really useful if you're diff -r daf52f813328 -r ccdc4c6183c0 packet.c --- a/packet.c Sun Jul 26 15:39:47 2009 +0000 +++ b/packet.c Sun Jul 26 16:11:27 2009 +0000 @@ -261,7 +261,7 @@ /* payload length */ /* - 4 - 1 is for LEN and PADLEN values */ - len = ses.readbuf->len - padlen - 4 - 1; + len = ses.readbuf->len - padlen - 4 - 1 - macsize; if ((len > RECV_MAX_PAYLOAD_LEN) || (len < 1)) { dropbear_exit("bad packet size"); }