diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-28 21:27:49 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-28 21:27:49 +0000 |
commit | 5fa67fe940e0ff8de826d049aaa127a059b31782 (patch) | |
tree | e238f85f6716296e49654e56d30f5334accd032d /usr.bin/ssh/packet.c | |
parent | db0d1191926a50d3b94b2e68df57caff3ef75dd8 (diff) |
use ignore message to simulate a SSH2_MSG_CHANNEL_DATA message
use random content in ignore messages.
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r-- | usr.bin/ssh/packet.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index c47f950a3be..67bbd83323f 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/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" @@ -1315,8 +1315,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) @@ -1344,7 +1343,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) |