[Ssh] Re: SSHM charter - next steps

Ron Frederick <ronf@timeheart.net> Wed, 11 September 2024 06:15 UTC

Return-Path: <ronf@timeheart.net>
X-Original-To: ssh@ietfa.amsl.com
Delivered-To: ssh@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4EB91C1CAF58 for <ssh@ietfa.amsl.com>; Tue, 10 Sep 2024 23:15:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=timeheart.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rLE5QsO4NE1W for <ssh@ietfa.amsl.com>; Tue, 10 Sep 2024 23:15:07 -0700 (PDT)
Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6BAD1C1D4CDE for <SSH@ietf.org>; Tue, 10 Sep 2024 23:15:07 -0700 (PDT)
Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-6bce380eb96so3914042a12.0 for <SSH@ietf.org>; Tue, 10 Sep 2024 23:15:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timeheart.net; s=mail; t=1726035306; x=1726640106; darn=ietf.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=qClA7TofGFtp9yUgTLLA2NPxJn0uF6IB/9bBT2ihNXc=; b=ZxNJDcjEvTsHgRMvKJocUzyGsjlMFPVFs0utjGkUxa3nrBzgSB32Wvgm7UvW1d67k5 8tp4AH8IqAuLfhb4kWJPK/Eqmv/wyii/GzSgMeuk7KoV2Ny+E1q9xhN/8zHBcu4iIBPq 68q0OJoAv/oaECZoMgSBbpoTiw5aF3o7wi9s0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726035306; x=1726640106; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qClA7TofGFtp9yUgTLLA2NPxJn0uF6IB/9bBT2ihNXc=; b=Fqufo3QU0/od0WmuzgYwUI5s0kRPOu/z1UAHIi17zkALEZSlM7a85y0D4eoMXVAqDd 4e1DRBy5EYj9cdBoXqGrKRsVtTVAwfo7beSGgVpnMmhoFE6i0NcRCCcygs5EFv2S+IaU nWZGQgh+yhVyXkM1mYZJS99mtYihMZgMa9FODHttNcuYd2zidWGIFlm+c2xRTGoQkwKF smVSDmQqwlHqrXMkLaAOOR1chZ50inTGRawxS+TE3y1Uyc0BeL2Eysq5OYZf9SVI1nPR r9mncHyjgpzxFs2hIW6bxmi6RnU0OuYLJchTlHpC2IKI+SXekqMs0T+wrQUaCcj9Fl1Q H9ag==
X-Gm-Message-State: AOJu0Yxv0WKbMJzC3ufWgSebfEvOT11LH7fSYxjT7DkGdpvL7Z9okDJi 0sv2sTIamXifZzQUmARHuAH+c8x4gWO79ce2a96po+OWqsGJnqxHu1iBuK5qUoM=
X-Google-Smtp-Source: AGHT+IELstPkUVFMzitOpj5YuBtKAigju3oMUvhrt8+tLiRpn7aJbErgzYj3PFY3CdFeee1Hv9ZWCg==
X-Received: by 2002:a17:902:d487:b0:201:efe7:cafc with SMTP id d9443c01a7336-2074c5eebb2mr41384145ad.23.1726035306032; Tue, 10 Sep 2024 23:15:06 -0700 (PDT)
Received: from smtpclient.apple ([2603:3024:1881:b900::1]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710f36266sm56869395ad.283.2024.09.10.23.15.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2024 23:15:05 -0700 (PDT)
From: Ron Frederick <ronf@timeheart.net>
Message-Id: <1CC88356-BD99-4A01-BDA5-095C88A6D02B@timeheart.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F10ABAD3-8800-4CA3-A216-A2511519F3EF"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Date: Tue, 10 Sep 2024 23:14:53 -0700
In-Reply-To: <8B799495-ECD1-4B7D-BFC5-7E24988A9B96@gmail.com>
To: mbaushke ietf <mbaushke.ietf@gmail.com>
References: <CAGgd1Oc138TGELbhtF_SkW9-m=S5WP9AMNAhxwR-3z3g4r=HXw@mail.gmail.com> <87o74x3srd.fsf@kaka.sjd.se> <CAGgd1Of8RTybdLGhqF8hxJD9UYHrEcyo+hffJQKyGySHrxEGZg@mail.gmail.com> <Zt_t2PRZdIxmUmnh@greenie.muc.de> <202409101215.IAA14303@Stone.Rodents-Montreal.ORG> <59AEE5F0-CEB7-4BE5-83FF-E71AD791E160@gmail.com> <202409101510.LAA22361@Stone.Rodents-Montreal.ORG> <238A4730-7474-4A5F-8741-4108750456C7@gmail.com> <202409110342.XAA15545@Stone.Rodents-Montreal.ORG> <8B799495-ECD1-4B7D-BFC5-7E24988A9B96@gmail.com>
X-Mailer: Apple Mail (2.3776.700.51)
Message-ID-Hash: PVXUHAA5STKAMPPXUNTMIWHKMB3NEMBJ
X-Message-ID-Hash: PVXUHAA5STKAMPPXUNTMIWHKMB3NEMBJ
X-MailFrom: ronf@timeheart.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: SSH@ietf.org
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Ssh] Re: SSHM charter - next steps
List-Id: "The SSH mail list will allow discussions on improving aspects of the Secure Shell (SSH) protocol." <ssh.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ssh/zrLQvKQJNPkW8KuA7z7J2PT4nWU>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ssh>
List-Help: <mailto:ssh-request@ietf.org?subject=help>
List-Owner: <mailto:ssh-owner@ietf.org>
List-Post: <mailto:ssh@ietf.org>
List-Subscribe: <mailto:ssh-join@ietf.org>
List-Unsubscribe: <mailto:ssh-leave@ietf.org>

Hi Mark,

On Sep 10, 2024, at 10:13 PM, mbaushke ietf <mbaushke.ietf@gmail.com> wrote:
> For AsyncSSH, I believe that the API uses send_env() for passing along environment variables.

For environment settings, AsyncSSH supports both ‘env’ and ’send_env’ arguments, which are the equivalent to OpenSSH’s SetEnv and SendEnv, respectively. The ‘env’ option lets you pass in a dictionary with Unicode string keys & values to send to the server as environment variables, and the ’send_env’ lets you pass a list of Unicode strings which will be looked up in the local environment and forwarded on to the server. In both cases, the Unicode string values are encoded using UTF-8 in the MSG_CHANNEL_REQUEST message, with a request type of ‘env’.

AsyncSSH also supports reading OpenSSH config files, and will fall back to using any SetEnv or SendEnv directives found there if the AsyncSSH ‘env’ and/or ’send_env’ options aren’t passed in. The data in the config file is expected to be encoded as UTF-8, if any non-ASCII bytes are present in it. Parsing failures will occur if the data is not valid UTF-8.

AsyncSSH can also be used as a server, but it is designed to let the application using it handle all the I/O on the sessions, rather than forking off a process to run a shell or execute a command. As a result, it doesn’t have a concept of ‘AcceptEnv’. It just passes the application the complete set of environment variables sent by the client and lets the application decide what it wants to do with these key/value pairs, if anything. As above, the data in the MSG_CHANNEL_REQUEST is decoded using UTF-8 and passed to the application as Unicode strings. Requests with invalid UTF-8 keys or values are ignored (with an optional debug-level log message).

For usernames and passwords, AsyncSSH applies SASLprep (RFC 4013) on the Unicode version of the value and then encodes the normalized result as UTF-8, as recommended by RFC 4252.

In other places, AsyncSSH will let the application specify an encoding explicitly, such as when reading and writing data on a channel. It also supports the ability to set the encoding to ’None’, which makes it accept and return raw bytes instead of Unicode strings, allowing arbitrary binary data to be sent and received.

I’d be curious about any encoding-related problems that people have run across, and would also be interested in interoperability testing with other SSH implementations if anyone is interested. I do some of my own testing against OpenSSH, and have also done limited testing against other implementations. So far, I haven’t run across any issues related to Unicode encoding.
-- 
Ron Frederick
ronf@timeheart.net