summaryrefslogtreecommitdiffstats
path: root/packet.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:28:06 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-05 06:28:06 +0000
commite229b25a9efc4924f9b45a34de0aef491ae35d09 (patch)
tree168b2a8e9d3615a86d39fd9d57b78053fc360b45 /packet.c
parent941ac82e1624e7d7bb7091785ca525889738420b (diff)
- markus@cvs.openbsd.org 2001/02/28 21:27:48
[channels.c packet.c packet.h serverloop.c] use ignore message to simulate a SSH2_MSG_CHANNEL_DATA message use random content in ignore messages.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/packet.c b/packet.c
index 26abf0e1..a1a5d8a7 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: packet.c,v 1.53 2001/02/28 09:57:06 markus Exp $");
+RCSID("$OpenBSD: packet.c,v 1.54 2001/02/28 21:27:47 markus Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -1321,8 +1321,7 @@ packet_set_maxsize(int s)
void
packet_inject_ignore(int sumlen)
{
- u_int32_t rand = 0;
- int i, blocksize, padlen, have, need, nb, mini, nbytes;
+ int blocksize, padlen, have, need, nb, mini, nbytes;
Enc *enc = NULL;
if (use_ssh2_packet_format == 0)
@@ -1350,7 +1349,16 @@ packet_inject_ignore(int sumlen)
/* enqueue current message and append a ignore message */
packet_send();
- packet_start(SSH2_MSG_IGNORE);
+ packet_send_ignore(nbytes);
+}
+
+void
+packet_send_ignore(int nbytes)
+{
+ u_int32_t rand = 0;
+ int i;
+
+ packet_start(compat20 ? SSH2_MSG_IGNORE : SSH_MSG_IGNORE);
packet_put_int(nbytes);
for(i = 0; i < nbytes; i++) {
if (i % 4 == 0)