summaryrefslogtreecommitdiff
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 26abf0e1a..a1a5d8a76 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.53 2001/02/28 09:57:06 markus Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.54 2001/02/28 21:27:47 markus Exp $");
41 41
42#include "xmalloc.h" 42#include "xmalloc.h"
43#include "buffer.h" 43#include "buffer.h"
@@ -1321,8 +1321,7 @@ packet_set_maxsize(int s)
1321void 1321void
1322packet_inject_ignore(int sumlen) 1322packet_inject_ignore(int sumlen)
1323{ 1323{
1324 u_int32_t rand = 0; 1324 int blocksize, padlen, have, need, nb, mini, nbytes;
1325 int i, blocksize, padlen, have, need, nb, mini, nbytes;
1326 Enc *enc = NULL; 1325 Enc *enc = NULL;
1327 1326
1328 if (use_ssh2_packet_format == 0) 1327 if (use_ssh2_packet_format == 0)
@@ -1350,7 +1349,16 @@ packet_inject_ignore(int sumlen)
1350 1349
1351 /* enqueue current message and append a ignore message */ 1350 /* enqueue current message and append a ignore message */
1352 packet_send(); 1351 packet_send();
1353 packet_start(SSH2_MSG_IGNORE); 1352 packet_send_ignore(nbytes);
1353}
1354
1355void
1356packet_send_ignore(int nbytes)
1357{
1358 u_int32_t rand = 0;
1359 int i;
1360
1361 packet_start(compat20 ? SSH2_MSG_IGNORE : SSH_MSG_IGNORE);
1354 packet_put_int(nbytes); 1362 packet_put_int(nbytes);
1355 for(i = 0; i < nbytes; i++) { 1363 for(i = 0; i < nbytes; i++) {
1356 if (i % 4 == 0) 1364 if (i % 4 == 0)