mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Fix log-censoring of incoming SSH-2 session data.
The call to ssh2_censor_packet for incoming packets in ssh2bpp was passing the wrong starting position in the packet data - in particular, not the same starting position as the adjacent call to log_packet - so the censor couldn't parse SSH2_MSG_CHANNEL_DATA to identify the string of session data that it should be bleeping out.
This commit is contained in:
parent
0bdda64724
commit
686e78e66b
@ -463,13 +463,14 @@ static void ssh2_bpp_handle_input(BinaryPacketProtocol *bpp)
|
|||||||
* SSH_MSG_UNIMPLEMENTED.
|
* SSH_MSG_UNIMPLEMENTED.
|
||||||
*/
|
*/
|
||||||
s->pktin->type = SSH_MSG_NO_TYPE_CODE;
|
s->pktin->type = SSH_MSG_NO_TYPE_CODE;
|
||||||
|
s->data += 5;
|
||||||
s->length = 0;
|
s->length = 0;
|
||||||
BinarySource_INIT(s->pktin, s->data + 5, 0);
|
|
||||||
} else {
|
} else {
|
||||||
s->pktin->type = s->data[5];
|
s->pktin->type = s->data[5];
|
||||||
|
s->data += 6;
|
||||||
s->length -= 6;
|
s->length -= 6;
|
||||||
BinarySource_INIT(s->pktin, s->data + 6, s->length);
|
|
||||||
}
|
}
|
||||||
|
BinarySource_INIT(s->pktin, s->data, s->length);
|
||||||
|
|
||||||
if (s->bpp.logctx) {
|
if (s->bpp.logctx) {
|
||||||
logblank_t blanks[MAX_BLANKS];
|
logblank_t blanks[MAX_BLANKS];
|
||||||
@ -479,7 +480,7 @@ static void ssh2_bpp_handle_input(BinaryPacketProtocol *bpp)
|
|||||||
log_packet(s->bpp.logctx, PKT_INCOMING, s->pktin->type,
|
log_packet(s->bpp.logctx, PKT_INCOMING, s->pktin->type,
|
||||||
ssh2_pkt_type(s->bpp.pls->kctx, s->bpp.pls->actx,
|
ssh2_pkt_type(s->bpp.pls->kctx, s->bpp.pls->actx,
|
||||||
s->pktin->type),
|
s->pktin->type),
|
||||||
get_ptr(s->pktin), get_avail(s->pktin), nblanks, blanks,
|
s->data, s->length, nblanks, blanks,
|
||||||
&s->pktin->sequence, 0, NULL);
|
&s->pktin->sequence, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user