[Ssh] Re: SSHM charter - next steps

Mouse <mouse@Rodents-Montreal.ORG> Thu, 12 September 2024 15:13 UTC

Return-Path: <mouse@Stone.Rodents-Montreal.ORG>
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 F3ADBC151076 for <ssh@ietfa.amsl.com>; Thu, 12 Sep 2024 08:13:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.907
X-Spam-Level:
X-Spam-Status: No, score=-1.907 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
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 bQKFgNUc-_0Q for <ssh@ietfa.amsl.com>; Thu, 12 Sep 2024 08:13:02 -0700 (PDT)
Received: from Stone.Rodents-Montreal.ORG (Stone.Rodents-Montreal.ORG [98.124.61.89]) by ietfa.amsl.com (Postfix) with ESMTP id EB143C15198F for <SSH@ietf.org>; Thu, 12 Sep 2024 08:13:01 -0700 (PDT)
Received: (from mouse@localhost) by Stone.Rodents-Montreal.ORG (8.8.8/8.8.8) id LAA10728; Thu, 12 Sep 2024 11:12:56 -0400 (EDT)
Date: Thu, 12 Sep 2024 11:12:56 -0400
From: Mouse <mouse@Rodents-Montreal.ORG>
Message-Id: <202409121512.LAA10728@Stone.Rodents-Montreal.ORG>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Erik-Conspiracy: There is no Conspiracy - and if there were I wouldn't be part of it anyway.
X-Message-Flag: Microsoft: the company who gave us the botnet zombies.
X-Composition-Start-Date: Thu, 12 Sep 2024 10:18:28 -0400 (EDT)
To: SSH@ietf.org
In-Reply-To: <31E3FCBA-BDA1-4AB8-B9CD-FCCAC6F726CA@timeheart.net>
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> <1CC88356-BD99-4A01-BDA5-095C88A6D02B@timeheart.net> <202409111246.IAA11712@Stone.Rodents-Montreal.ORG> <31E3FCBA-BDA1-4AB8-B9CD-FCCAC6F726CA@timeheart.net>
Message-ID-Hash: KVHIWQQAXIYYQJ43DZRZ2SO3EOBE545Y
X-Message-ID-Hash: KVHIWQQAXIYYQJ43DZRZ2SO3EOBE545Y
X-MailFrom: mouse@Stone.Rodents-Montreal.ORG
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
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/l5bNp5Pxh-gtFn5dgiy-DV-OT2s>
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>

(In passing, it would help readability if you would avoid using
paragraph-length lines.  If you want readers to reflow your text,
format=flowed would be your friend.)

>> Well, the current spec does not support handling non-UTF-8 octet
>> sequences in these places.  Environment variables, even more than
>> usernames, have always been octet sequences rather than character
>> sequences.  I count that as an encoding-related problem, though a
>> problem with the spec, not with any particular implementation.

Actually, I've reread that part of the spec.  The name and value in env
requests are "string"s, which means there is no particular encoding
requirement at that level; I haven't found any statement that the name
and/or value strings have any additional restrictions on them.  So,
unless I've missed something (hardly impossible), for environment
variables the incompatibility is nonexistent at the ssh protocol level.
If that means just pushing it off to upper levels, well, see xkcd 927.

> I think the intent of mandating an encoding is to improve interoperability i$

Presumably.  But it ends up making the spec unimplementable in some
cases, because (for example) some systems don't store usernames as
character strings, only octet strings.  You write of "whatever local
encoding that system is using" - this assumes those octet sequences
represent characters (which may not be true; see below), and,
furthermore, that the encoding is somewhere accessible to the
implementation.  This is false often enough to be problematic.  Suppose
my /etc/passwd has a username field consisting of the three octets (in
hex) c5, b2, 30.  Is that A-ring, superscript-2, zero (8859-1)?  Is it
A-ring, G-with-dot-above, zero (8859-14)?  Is it U-ogonek, zero
(UTF-8)?  Is it something else (KOI-8 maybe)?  Without consulting with
the user who chose the username, I can't tell; software has no hope of
telling.

It is plausible to claim that those octets represent characters at the
human level.  Even that, though, is debatable; octet sequences, even
sometimes octet sequences in places typically used for character
strings, do sometimes get used to store (possibly encoded) binary data,
and there exist systems where usernames are for mechanized consumption
rather than human consumption.

Furthermore, even if those octets _do_ represent characters at the
human level, how is software supposed to get at that information?  None
of my computers have mindreading hardware; would you say I need to run
shell startup for each username on the system to find out what its
locale settings are (and what if someone doesn't have any?) when my ssh
server receives a username?  Or do I have to mandate that everyone's
username uses the same encoding in order for my system to have the
privilege of using ssh (and where do I store that encoding)?  Or maybe
I need to redesign the OS's username database to add character set tags
to usernames?  And, on top of all that, this would mandate that every
ssh implementation contain all the hair that is Unicode normalization.

Eh, no.  Personally, I consider usefulness more important than
conformance to some fantasy world in which all those octet sequences
are somehow marked with character set and encoding tags.  That's why
moussh treats those as opaque octet sequences.

> I havenâ??t checked to see if OpenSSH converts to/from UTF-8 or not if you a$

I'd be interested to know what you find.  If it recodes, I'd also be
interested to know where it gets its idea of the "local encoding".

For that matter, you were writing (upthread) as if you are resposible
for AsyncSSH.  Assuming that's true, what does _it_ do to recode (say)
the octets representing the local username into UTF-8 for transmission?
Error if not already UTF-8?  If not, where does it get the relevant
encoding from?

>> There also are places where it's not clear whether there's an
>> encoding issue.  For example, in a pty-req channel request, there is
>> a "string" which is documented as "TERM environment variable value".
>> It is not clear whether this use of "string" is text in the sense
>> described on 4251 page 9.
> There is already a terminal type field in the SSH 'pty-reqâ?? channel messag$

There is.  That's exactly the field I'm talking about.  4254 documents
it as

      string    TERM environment variable value (e.g., vt100)

which (a) assumes that terminal types are strings, (b) that the system
has environment variables, (c) that the terminal type is kept in one,
and (d) that variable's name is TERM.  It basically amounts to assuming
the whole world is UNIX variants.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse@rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B