9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: iru.muzgo@gmail.com, ori@eigenstate.org
Cc: 9front@9front.org
Subject: Re: [9front] vncv(1): support for RFB 3.8
Date: Sat, 26 Sep 2020 12:58:00 -0700	[thread overview]
Message-ID: <EF093381C8E99796F1350E8030900B5B@eigenstate.org> (raw)
In-Reply-To: <8917ba98-ba07-096f-eaed-3fa98f4c001c@gmail.com>

> On 23/09/2020 01:25, ori@eigenstate.org wrote:
>> > Hi,
>> >
>> > The following patch adds support for RFB 3.8 in vncv(1).
>> > It has been tested by connecting to a screen shared by gnome3 on
>> > linux. Please let me know if it introduces any regressions.
>>
>> Can you re-generate the patch and either add it as an attachment
>> or send it through something other than gmail's web interface?
>>
>> gmail mangles patches, wrappigng them and replacing tabs with
>> spaces.
>>
> here it goes

First off -- gross, newer versions let the client downgrade
security. This is the opposite of what should be happening.
But that's what the RFC says, so I guess we go with it.

Ok with it in the client, but let's never implement it in the
server.

That said: Looking at the RFC, there are 3 versions of
the protocol that should not be treated as 3.3:

> Any version reported other than 3.7 or 3.8 should be treated as 3.3.

Accordingly, we should probably recognize and error on 3.7 here, since
we don't implement it.

+	if(strncmp(msg, "RFB 003.", 8) != 0) {
 		werrstr("bad rfb version \"%s\"", msg);
 		return -1;
 	}

Something like:

	if(strncmp(msg, "RFB 003.", 8) != 0
	|| strncmp(msg, "RFB 003.007", VerLen) == 0)
 		werrstr("bad rfb version \"%s\"", msg);
 		return -1;
 	}

The zero types case also looks like it could be improved too:
The RFC says:


   If number-of-security-types is zero, then for some reason the
   connection failed (e.g., the server cannot support the desired
   protocol version).  This is followed by a string describing the
   reason (where a string is specified as a length followed by that many
   ASCII characters):

             +---------------+--------------+---------------+
             | No. of bytes  | Type [Value] | Description   |
             +---------------+--------------+---------------+
             | 4             | U32          | reason-length |
             | reason-length | U8 array     | reason-string |
             +---------------+--------------+---------------+

   The server closes the connection after sending the reason-string.

It'd be nice to show the server message to the user, it'd help
with debugging (maybe). Something like:


	char *err;
	ntypes = vncrdchar(v);
	if (ntypes == 0) {
		err = vncrdstring(v);
		werrstr("auth error: %s", s);
		free(err);
		return AFailed;
	}

I don't have a vnc 3.8 server set up right now for testing, so if
you want to look over the proposed changes and test, that'd be
great.

Thanks for the patch!



  reply	other threads:[~2020-09-26 19:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 17:37 Iruatã Souza
2020-09-22 18:25 ` Iruatã Souza
2020-09-22 20:08   ` [9front] " ori
2020-09-22 20:11     ` ori
2020-09-22 20:36       ` Silas McCroskey
     [not found]         ` <CABJnqBRGr4cjFJsnuSjEUjHWtRyvDd2Pq9xZ=2Xn3jOziWKEiw@mail.gmail.com>
2020-09-22 23:10           ` Silas McCroskey
2020-09-22 23:31             ` hiro
2020-09-22 23:25 ` [9front] " ori
2020-09-23  6:41   ` Iruatã Souza
2020-09-26 19:58     ` ori [this message]
2020-09-26 20:42       ` hiro
2020-09-26 21:31         ` ori
2020-09-27 17:12       ` Iruatã Souza
2020-09-27 16:58         ` ori
2020-09-26 19:39   ` kvik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EF093381C8E99796F1350E8030900B5B@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    --cc=iru.muzgo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).