Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfgdQ-00085f-NA for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:27:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfgdP-00084R-B6 for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:27:08 -0500 Received: from [199.232.76.173] (port=46327 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfgdP-00084O-5B for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:27:07 -0500 Received: from savannah.gnu.org ([199.232.41.3]:42057 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LfgdO-0000PZ-S4 for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:27:06 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LfgdK-0000cS-MI for qemu-devel@nongnu.org; Fri, 06 Mar 2009 20:27:02 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LfgdK-0000cN-C2 for qemu-devel@nongnu.org; Fri, 06 Mar 2009 20:27:02 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 06 Mar 2009 20:27:02 +0000 Subject: [Qemu-devel] [6719] Fix bug in TLS authentication ("Daniel P. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6719 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6719 Author: aliguori Date: 2009-03-06 20:27:02 +0000 (Fri, 06 Mar 2009) Log Message: ----------- Fix bug in TLS authentication ("Daniel P. Berrange") This patch was previously posted here: http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00820.html In the case where the TLS handshake does *not* block on I/O, QEMU sends the next 'start sub-auth' message twice. This seriously confuses the VNC client :-) Fortunately the chances of the handshake not blocking are close to zero for a TCP socket, which is why it has not been noticed thus far. Even with both client & server on localhost, I can only hit the bug 1 time in 20. NB, the diff context here is not too informative. If you look at the full code you'll see that a few lines early we called vnc_start_tls() which called vnc_continue_handshake() which called the method start_auth_vencrypt_subauth(). Hence, fixing the bug, just involves removing the 2nd bogus call to start_auth_vencrypt_subauth() as per this patch. vnc.c | 8 -------- 1 file changed, 8 deletions(-) Signed-off-by: Daniel P. Berrange Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/vnc.c Modified: trunk/vnc.c =================================================================== --- trunk/vnc.c 2009-03-05 23:01:55 UTC (rev 6718) +++ trunk/vnc.c 2009-03-06 20:27:02 UTC (rev 6719) @@ -2098,14 +2098,6 @@ VNC_DEBUG("Failed to complete TLS\n"); return 0; } - - if (vs->wiremode == VNC_WIREMODE_TLS) { - VNC_DEBUG("Starting VeNCrypt subauth\n"); - return start_auth_vencrypt_subauth(vs); - } else { - VNC_DEBUG("TLS handshake blocked\n"); - return 0; - } } return 0; }