diff --git a/common-packet.c b/packet.c
similarity index 98%
rename from common-packet.c
rename to packet.c
index 39387bf84aff08540577863ad9d3a88c7dc87665..886fe67c484b42d77b7658d5174d132a77aa4c86 100644
--- a/common-packet.c
+++ b/packet.c
@@ -444,6 +444,10 @@ void encrypt_packet() {
 	}
 
 	/* finished with payload */
+	buf_burn(ses.writepayload); /* XXX This is probably a good idea, and isn't
+								   _that_ likely to hurt performance too badly.
+								   Buffers can have cleartext passwords etc, or
+								   other sensitive data */
 	buf_setpos(ses.writepayload, 0);
 	buf_setlen(ses.writepayload, 0);
 
diff --git a/process-packet.c b/process-packet.c
index afa45efd92acb22cba3f7f8a2c74a3285bd78a7e..f9f6dee366f58e34bf7b5923820a7fd93b8eb583 100644
--- a/process-packet.c
+++ b/process-packet.c
@@ -116,7 +116,7 @@ void process_packet() {
 	 * less-than-or-equal-to 60 ( == MAX_UNAUTH_PACKET_TYPE ).
 	 * NOTE: if the protocol changes and new types are added, revisit this 
 	 * assumption */
-	if ( !ses.authdone && type > MAX_UNAUTH_PACKET_TYPE ) {
+	if ( !ses.authstate.authdone && type > MAX_UNAUTH_PACKET_TYPE ) {
 		dropbear_exit("received message %d before userauth", type);
 	}
 
@@ -138,6 +138,7 @@ void process_packet() {
 	recv_unimplemented();
 
 out:
+	buf_burn(ses.payload); /* Clear the memory to avoid swapping it out */
 	buf_free(ses.payload);
 	ses.payload = NULL;