aports/main/openssh/ObscureKeystrokeTiming.patch
2024-07-02 15:52:46 +00:00

20 lines
840 B
Diff

Date: Mon, 1 Jul 2024 18:21:11 +1000 (AEST)
From: Damien Miller <djm@mindrot.org>
Patch-Source: https://lists.mindrot.org/pipermail/openssh-unix-dev/2024-July/041431.html
diff --git a/clientloop.c b/clientloop.c
index 8ec36af94..6dcd6c853 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -608,8 +608,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout,
if (timespeccmp(&now, &chaff_until, >=)) {
/* Stop if there have been no keystrokes for a while */
stop_reason = "chaff time expired";
- } else if (timespeccmp(&now, &next_interval, >=)) {
- /* Otherwise if we were due to send, then send chaff */
+ } else if (timespeccmp(&now, &next_interval, >=) &&
+ !ssh_packet_have_data_to_write(ssh)) {
+ /* If due to send but have no data, then send chaff */
if (send_chaff(ssh))
nchaff++;
}