]> andersk Git - openssh.git/blobdiff - packet.c
- OpenBSD CVS updates.
[openssh.git] / packet.c
index d50e26071ef21b40f42049bced9d254643989535..4000698c7520783f353ec0b77793b2096037965c 100644 (file)
--- 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.
  *
@@ -529,7 +529,7 @@ packet_send2()
        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 @@ packet_send2()
        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 @@ packet_read_poll2(int *payload_len_ptr)
         * 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 @@ packet_read_poll2(int *payload_len_ptr)
                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 @@ packet_get_raw(int *length_ptr)
        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
This page took 0.035452 seconds and 4 git commands to generate.