]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ui: ensure VNC websockets server checks the ACL if requested
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 17 Mar 2015 13:43:00 +0000 (13:43 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 18 Mar 2015 08:25:14 +0000 (09:25 +0100)
If the x509verify option is requested, the VNC websockets server
was failing to validate that the websockets client provided an
x509 certificate matching the ACL rules.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc-ws.c

index 5f9fcc42db35e36d7d7487bd678906b5e7ac1d1e..85dbb7e6ae36d3421c21cf0d7c517b121de2bb56 100644 (file)
@@ -45,6 +45,16 @@ static int vncws_start_tls_handshake(struct VncState *vs)
         return -1;
     }
 
+    if (vs->vd->tls.x509verify) {
+        if (vnc_tls_validate_certificate(vs) < 0) {
+            VNC_DEBUG("Client verification failed\n");
+            vnc_client_error(vs);
+            return -1;
+        } else {
+            VNC_DEBUG("Client verification passed\n");
+        }
+    }
+
     VNC_DEBUG("Handshake done, switching to TLS data mode\n");
     qemu_set_fd_handler2(vs->csock, NULL, vncws_handshake_read, NULL, vs);