[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH][Take 3] VNC authentification



Daniel P. Berrange wrote:
On Tue, Oct 03, 2006 at 12:56:31PM -0500, Anthony Liguori wrote:
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.

Yeah, the impl of protocol_authtype() in there is a no-op too - it should
be rejecting auth types which aren't supported, even if it was being invoked.
With the code as it is, protocol_authtype never runs & the server starts
doing VNCAuth regardless of what the client says it wants to do, which is
clearly not correct.

Another thing to keep in mind, is that the reason I did 3.3 instead of 3.8 is that I knew there was only one auth type we would be supporting. If we do support multiple auth types, we really ought to move to using the 3.8 protocol since that provides a negotiation mechanism.

Regards,

Anthony Liguori

Dan.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.