]> andersk Git - openssh.git/blobdiff - packet.c
- stevesk@cvs.openbsd.org 2001/12/29 21:56:01
[openssh.git] / packet.c
index 3b25223568838700dcf959c4aa261af9cc99b947..5d97c379edf9c505441f1e76667e76184253776e 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: packet.c,v 1.82 2001/12/28 14:50:54 markus Exp $");
+RCSID("$OpenBSD: packet.c,v 1.83 2001/12/29 21:56:01 stevesk Exp $");
 
 #include "xmalloc.h"
 #include "buffer.h"
@@ -399,7 +399,7 @@ packet_send1(void)
        buffer_consume(&outgoing_packet, 8 - padding);
 
        /* Add check bytes. */
-       checksum = ssh_crc32((u_char *) buffer_ptr(&outgoing_packet),
+       checksum = ssh_crc32(buffer_ptr(&outgoing_packet),
            buffer_len(&outgoing_packet));
        PUT_32BIT(buf, checksum);
        buffer_append(&outgoing_packet, buf, 4);
@@ -505,7 +505,7 @@ packet_send2(void)
        }
        block_size = enc ? enc->cipher->block_size : 8;
 
-       ucp = (u_char *) buffer_ptr(&outgoing_packet);
+       ucp = buffer_ptr(&outgoing_packet);
        type = ucp[5];
 
 #ifdef PACKET_DEBUG
@@ -561,7 +561,7 @@ packet_send2(void)
        }
        /* packet_length includes payload, padding and padding length field */
        packet_length = buffer_len(&outgoing_packet) - 4;
-       ucp = (u_char *)buffer_ptr(&outgoing_packet);
+       ucp = buffer_ptr(&outgoing_packet);
        PUT_32BIT(ucp, packet_length);
        ucp[4] = padlen;
        DBG(debug("send: len %d (includes padlen %d)", packet_length+4, padlen));
@@ -569,7 +569,7 @@ packet_send2(void)
        /* compute MAC over seqnr and packet(length fields, payload, padding) */
        if (mac && mac->enabled) {
                macbuf = mac_compute(mac, seqnr,
-                   (u_char *) buffer_ptr(&outgoing_packet),
+                   buffer_ptr(&outgoing_packet),
                    buffer_len(&outgoing_packet));
                DBG(debug("done calc MAC out #%d", seqnr));
        }
@@ -708,7 +708,7 @@ packet_read_poll1(void)
        if (buffer_len(&input) < 4 + 8)
                return SSH_MSG_NONE;
        /* Get length of incoming packet. */
-       ucp = (u_char *) buffer_ptr(&input);
+       ucp = buffer_ptr(&input);
        len = GET_32BIT(ucp);
        if (len < 1 + 2 + 2 || len > 256 * 1024)
                packet_disconnect("Bad packet length %d.", len);
@@ -745,7 +745,7 @@ packet_read_poll1(void)
 #endif
 
        /* Compute packet checksum. */
-       checksum = ssh_crc32((u_char *) buffer_ptr(&incoming_packet),
+       checksum = ssh_crc32(buffer_ptr(&incoming_packet),
            buffer_len(&incoming_packet) - 4);
 
        /* Skip padding. */
@@ -756,7 +756,7 @@ packet_read_poll1(void)
                packet_disconnect("packet_read_poll1: len %d != buffer_len %d.",
                    len, buffer_len(&incoming_packet));
 
-       ucp = (u_char *) buffer_ptr(&incoming_packet) + len - 4;
+       ucp = (u_char *)buffer_ptr(&incoming_packet) + len - 4;
        stored_checksum = GET_32BIT(ucp);
        if (checksum != stored_checksum)
                packet_disconnect("Corrupted check bytes on input.");
@@ -805,7 +805,7 @@ packet_read_poll2(u_int32_t *seqnr_p)
                cp = buffer_append_space(&incoming_packet, block_size);
                cipher_decrypt(&receive_context, cp, buffer_ptr(&input),
                    block_size);
-               ucp = (u_char *) buffer_ptr(&incoming_packet);
+               ucp = buffer_ptr(&incoming_packet);
                packet_length = GET_32BIT(ucp);
                if (packet_length < 1 + 4 || packet_length > 256 * 1024) {
                        buffer_dump(&incoming_packet);
@@ -840,7 +840,7 @@ packet_read_poll2(u_int32_t *seqnr_p)
         */
        if (mac && mac->enabled) {
                macbuf = mac_compute(mac, seqnr,
-                   (u_char *) buffer_ptr(&incoming_packet),
+                   buffer_ptr(&incoming_packet),
                    buffer_len(&incoming_packet));
                if (memcmp(macbuf, buffer_ptr(&input), mac->mac_len) != 0)
                        packet_disconnect("Corrupted MAC on input.");
This page took 0.058975 seconds and 4 git commands to generate.