- OpenBSD CVS updates.
   [ssh.1 ssh.c]
   - ssh -2
   [auth.c channels.c clientloop.c packet.c packet.h serverloop.c]
   [session.c sshconnect.c]
   - check payload for (illegal) extra data
   [ALL]
   - whitespace cleanup
diff --git a/packet.c b/packet.c
index b0dfe4a..cb8fa15 100644
--- a/packet.c
+++ b/packet.c
@@ -1,14 +1,14 @@
 /*
- * 
+ *
  * packet.c
- * 
+ *
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
- * 
+ *
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
- * 
+ *
  * Created: Sat Mar 18 02:40:40 1995 ylo
- * 
+ *
  * This file contains code implementing the packet protocol and communication
  * with the other side.  This same code is used both on client and server side.
  *
@@ -17,7 +17,7 @@
  */
 
 #include "includes.h"
-RCSID("$Id: packet.c,v 1.17 2000/04/13 02:26:37 damien Exp $");
+RCSID("$Id: packet.c,v 1.18 2000/04/16 01:18:43 damien Exp $");
 
 #ifdef HAVE_OPENSSL
 # include <openssl/bn.h>
@@ -529,7 +529,7 @@
 	unsigned int packet_length = 0;
 	unsigned int i, padlen, len;
 	u_int32_t rand = 0;
-        static unsigned int seqnr = 0;
+	static unsigned int seqnr = 0;
 	int type;
 	Enc *enc   = NULL;
 	Mac *mac   = NULL;
@@ -611,9 +611,9 @@
 	fprintf(stderr, "encrypted: ");
 	buffer_dump(&output);
 #endif
-        /* increment sequence number for outgoing packets */
-        if (++seqnr == 0)
-                log("outgoing seqnr wraps around");
+	/* increment sequence number for outgoing packets */
+	if (++seqnr == 0)
+		log("outgoing seqnr wraps around");
 	buffer_clear(&outgoing_packet);
 
 	if (type == SSH2_MSG_NEWKEYS) {
@@ -877,7 +877,7 @@
 	 * compute MAC over seqnr and packet,
 	 * increment sequence number for incoming packet
 	 */
-        if (mac && mac->enabled) {
+	if (mac && mac->enabled) {
 		macbuf = hmac( mac->md, seqnr,
 		    (unsigned char *) buffer_ptr(&incoming_packet),
 		    buffer_len(&incoming_packet),
@@ -888,8 +888,8 @@
 		DBG(debug("HMAC #%d ok", seqnr));
 		buffer_consume(&input, mac->mac_len);
 	}
-        if (++seqnr == 0)
-                log("incoming seqnr wraps around");
+	if (++seqnr == 0)
+		log("incoming seqnr wraps around");
 
 	/* get padlen */
 	cp = buffer_ptr(&incoming_packet) + 4;
@@ -1063,6 +1063,12 @@
 	return buffer_ptr(&incoming_packet);
 }
 
+int
+packet_remaining(void)
+{
+	return buffer_len(&incoming_packet);
+}
+
 /*
  * Returns a string from the packet data.  The string is allocated using
  * xmalloc; it is the responsibility of the calling program to free it when