Subject: Questions on X11 forwarding

From: [email-masked] (Niels Möller)
Date: Thu, 22 May 2008 22:29:19 +0200

I'm now reimplementing X11 forwarding, and I have some questions.
There are two other known problems which have been discussed earlier:

1. It would make more sense to *not* have any authentication info in
   this message, and instead put the responsibility of setting up
   proper authentication on the server. Then one also gets rid of the
   wart that the cookie must be hex-encoded.

2. The channel open message,

      byte      SSH_MSG_CHANNEL_OPEN
      string    "x11"
      uint32    sender channel
      uint32    initial window size
      uint32    maximum packet size
      string    originator address (e.g., "192.168.7.38")
      uint32    originator port

   should really include a channel id of the session for whch the
   forwarding was set up (or some other id that lets the client
   distinguish between several active x11 forwardings).

I haven't been active on this list for a while. I remember somebody
proposing some solution for the second problem. Has there been any
progress made? Something along the lines of

      byte      SSH_MSG_CHANNEL_REQUEST
      uint32    recipient channel
      string    "x11-req-foo"
      boolean   want reply
      boolean   single connection
      uint32    x11 screen number

      byte      SSH_MSG_CHANNEL_OPEN
      string    "x11-foo"
      uint32    sender channel
      uint32    initial window size
      uint32    maximum packet size
      uint32    corresponding session channel
      string    originator address (e.g., "192.168.7.38")
      uint32    originator port

Has anybody else already implemented something like that?

Regards,
/Niels

---

From: Nicolas Williams <[email-masked]>
Date: Thu, 22 May 2008 15:53:34 -0500

>    wart that the cookie must be hex-encoded.

I agree.  And I agree with (2) as well.

> progress made? Something along the lines of

There's been very little activity on the list.

> Has anybody else already implemented something like that?

No, but I support this.

Nico
--

---

From: der Mouse <[email-masked]>
Date: Thu, 22 May 2008 16:41:01 -0400 (EDT)

>    proper authentication on the server.

True.  But then, please...

> [...]

...er, you beat me to it. :-)  I'd prefer to have an opaque cookie in
the request which ise sent back in the channel-open (that way multiple
forwarding requests per channel could be useful) but something of the
sort is essential enough to me that I implemented a private request for
X forwarding to get it.

> progress made?

Well, there's my implementation of X forwarding. :)  Here's how it
works, largely copied straight out of the private-algs.txt file from
moussh.

	byte	SSH_MSG_CHANNEL_REQUEST
	uint32	recipient channel
	string	"[email-masked]"
	boolean	want reply
	boolean	just-once
	uint32	cookie
	uint32	X screen number

("cookie" has nothing to do with MIT-MAGIC-COOKIE-1; it's just 32 bits
of opaque data which gets reflected back in the CHANNEL_OPEN.)

	byte	SSH_MSG_CHANNEL_OPEN
	string	"[email-masked]"
	uint32	sender channel
	uint32	initial window size
	uint32	maximum packet size
	uint32	cookie
	string	connection family
	...connection-family-specific data...

where, for TCP connections, the connection family is "tcp" and the
family-specific data is

	string	remote host
	uint32	remote port

I envision "local" as a family, too, which would typically correspond
to /tmp/.X11-unix/X(num), but haven't yet implemented that.  I'm not
sure what its additional data would be - nothing, probably.  Possibly
others, if I ever use an X setup that supports anything other than TCP
or local (maybe "decnet" on Ultrix?).

There's also [email-masked], which is just like
the -2 version described above except that it has no just-once flag,
semantically equivalent to the -2 version with just-once set false.

This form of X forwarding works just fine in my experience, including
working through connection sharing.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       [email-masked]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B