From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH][Take 3] VNC authentification Date: Tue, 03 Oct 2006 12:56:31 -0500 Message-ID: <4522A44F.1020700@us.ibm.com> References: <3AAA99889D105740BE010EB6D5A5A3B202A3D2@paddington.ad.cl.cam.ac.uk> <20060929221145.GE8564@redhat.com> <20061002162232.GB1730@redhat.com> <45214B54.8060805@us.ibm.com> <20061002181231.GC1730@redhat.com> <3AAA99889D105740BE010EB6D5A5A3B202A4F0@paddington.ad.cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Masami Watanabe Cc: Ian Pratt , xen-devel@lists.xensource.com, "Daniel P. Berrange" List-Id: xen-devel@lists.xenproject.org Masami Watanabe wrote: > +static int vnc_auth(VncState *vs) > +{ > + extern char vncpasswd[64]; > + extern unsigned char challenge[AUTHCHALLENGESIZE]; > + > + if (*vncpasswd == '\0') { > + /* AuthType is None */ > + vnc_write_u32(vs, 1); > + vnc_flush(vs); > + vnc_read_when(vs, protocol_client_init, 1); > + } else { > + /* AuthType is VncAuth */ > + vnc_write_u32(vs, 2); > + vnc_flush(vs); > + > + /* Read AuthType */ > + vnc_read_when(vs, protocol_authtype, 1); > As I mentioned before, you cannot have to vnc_read_when()'s execution path without returning the the mainloop. protocol_authtype() cannot possibly be invoked. If the code is working now, it's pure luck. There was just a very high profile RealVNC vulnerability that was due to improper authtype handling. It's very important we do this right so we don't duplicate this bug. Regards, Anthony Liguori > + /* Send Challenge */ > + make_challenge(challenge, AUTHCHALLENGESIZE); > + vnc_write(vs, challenge, AUTHCHALLENGESIZE); > + vnc_flush(vs); > + > + /* Read Responce */ > + vnc_read_when(vs, protocol_response, AUTHCHALLENGESIZE); > + } > + > + return 0; > +} > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >