Skip to content

Commit 146c420

Browse files
committed
upstream: when sending ObscureKeystrokeTiming chaff packets, we
can't rely on channel_did_enqueue to tell that there is data to send. This flag indicates that the channels code enqueued a packet on _this_ ppoll() iteration, not that data was enqueued in _any_ ppoll() iteration in the timeslice. ok markus@ OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136
1 parent 637e4df commit 146c420

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clientloop.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: clientloop.c,v 1.407 2024/05/17 06:42:04 jsg Exp $ */
1+
/* $OpenBSD: clientloop.c,v 1.408 2024/07/01 04:31:17 djm Exp $ */
22
/*
33
* Author: Tatu Ylonen <[email protected]>
44
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
@@ -607,8 +607,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout,
607607
if (timespeccmp(&now, &chaff_until, >=)) {
608608
/* Stop if there have been no keystrokes for a while */
609609
stop_reason = "chaff time expired";
610-
} else if (timespeccmp(&now, &next_interval, >=)) {
611-
/* Otherwise if we were due to send, then send chaff */
610+
} else if (timespeccmp(&now, &next_interval, >=) &&
611+
!ssh_packet_have_data_to_write(ssh)) {
612+
/* If due to send but have no data, then send chaff */
612613
if (send_chaff(ssh))
613614
nchaff++;
614615
}

0 commit comments

Comments
 (0)