From nobody Fri Jul 05 13:16:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WFvDf5Hjmz5PNYC; Fri, 05 Jul 2024 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFvDf4hlQz42KG; Fri, 5 Jul 2024 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720185410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0TGMVQzJRhLhd9MgdhKZYO2rkGq5vDdKW+JtQoSOI=; b=Q2EnnNK+jY1ckVQPB9xSI1XT/6T9oTEH1lOzc0PMYJ2YcAu3A2Tn4RbO2lT5gBYooOnyCH z49scTn4WETcny6S9ndDQZlPp5m60KCTdFg3PzXlCUBmetBvY/Q9+FlG3M2CthPNaGIV0M fEttOo8wYaMoYj74CWmxJN18FpUbPMnPK3Ce74gghjdRgqZ5PT1znBStxv3YyqWuz0GuD5 Y4uEefCgHi5ynEd2MX2xMZHg/SZVvZ1CsqX80mbpuEt+ODDowk01fukhyzc3Kte2PQNWsH 3aHw5TI2uLp2xQLmRevojj5ASg4a3Dd+rbedXwG7UrpO07bQH+R67iT5gQDWrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720185410; a=rsa-sha256; cv=none; b=tF4rzep9nZq8E7F48NWDdv83YIAz+YiE71b1dRXFKYaGE/SKHdn1nVw04E4cejrMtlxouy shRN2CqVQxJbKfI1u5WQYUhOlTFBVdt+OVgzRKAd5MAKvv0fNthzK5bWCbXAEs4zoh1+AP jlVlZQPpOG4gS/435DG/jhEgwSSZM2fr1hOT4TIUG/qU/125L4WLAoR2LV8MWoq9R8yhiO bzacxjDj6zkuVyb4M20WAMmrdJTiXkgzbFI23Af8xVTTPPjY/5yHePgJy6+2m17FnmuF6W NxokXU0Pl9ECBtsrrO+kiAN0WYa3nvAtAm1o0hGVnrcZR4mG3hZQBHGNM4IE2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720185410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0TGMVQzJRhLhd9MgdhKZYO2rkGq5vDdKW+JtQoSOI=; b=ECuarq4W+dUclh8Lb0KlQk6yP3AD7krieYAG1ekf3uy56FHIw3akVVFy1J+mOE7NgW5DLn 7l571qpVXY0lxWBZPVx7rq4qC4TrV4RZSW8ljUSDPwm3krGPbeOc7tbEePjFv5DVLxvuaY N0DMxbWJVAfjKO9FlvElWgSyXB6Qdob8Fajb4e1rJlFV98QrPMIrIH6Ghf5xRNMVrcEq63 VgpnDWwqT+RW+wlKxO/oLqJe4Iafpf1KWN/OD/dd4cJoaCIjgpNSWvFMAfKt6Zkc3Wtezf kCmmOk3D+aYTCz7ZHw5GrncZyDJ0UZzGhF+RIzjGQ4irfTbt8Ows0Ls4YV8Jcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFvDf4J9wzyLg; Fri, 5 Jul 2024 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 465DGoCe097486; Fri, 5 Jul 2024 13:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465DGoJm097483; Fri, 5 Jul 2024 13:16:50 GMT (envelope-from git) Date: Fri, 5 Jul 2024 13:16:50 GMT Message-Id: <202407051316.465DGoJm097483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b81424adf718 - main - OpenSSH: correct logic error in ObscureKeystrokeTiming List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b81424adf7181d816c10b1345aaa3305ab0ec304 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b81424adf7181d816c10b1345aaa3305ab0ec304 commit b81424adf7181d816c10b1345aaa3305ab0ec304 Author: Ed Maste AuthorDate: 2024-07-01 13:14:15 +0000 Commit: Ed Maste CommitDate: 2024-07-05 13:16:40 +0000 OpenSSH: correct logic error in ObscureKeystrokeTiming Cherry-pick fix: 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 Obtained from: openssh-portable 146c420d29d0 Reviewed by: gordon Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45823 --- crypto/openssh/clientloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c index 8ec36af94b3f..6dcd6c8535aa 100644 --- a/crypto/openssh/clientloop.c +++ b/crypto/openssh/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++; }