From bcd541d65f93365ff665749419844620ec2c6eeb Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Sun, 26 Jul 2009 16:11:27 +0000
Subject: [PATCH] - Payload length doesn't include macsize.

--HG--
extra : convert_revision : 98ac17a573ab350cbd6e358b3943237d2ad5c9cf
---
 debug.h  | 2 +-
 packet.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debug.h b/debug.h
index b8c2a575..a9cc0bd7 100644
--- a/debug.h
+++ b/debug.h
@@ -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 --git a/packet.c b/packet.c
index 37ffdd2d..9621bbd3 100644
--- a/packet.c
+++ b/packet.c
@@ -261,7 +261,7 @@ void decrypt_packet() {
 		
 	/* 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");
 	}
-- 
GitLab