summaryrefslogtreecommitdiffstats
path: root/main/xen/qemu-xen-websocket-plain-hack.patch
blob: acfabe7a98c3124b2f3c394629fdd00c24622a8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- xen-4.3.0/tools/qemu-xen/ui/vnc-ws.c
+++ xen-4.3.0.mod/tools/qemu-xen/ui/vnc-ws.c
@@ -90,11 +90,6 @@
     vncws_tls_handshake(vs);
 }
 
-#define NEED_X509_AUTH(vs)                              \
-    ((vs)->subauth == VNC_AUTH_VENCRYPT_X509NONE ||   \
-     (vs)->subauth == VNC_AUTH_VENCRYPT_X509VNC ||    \
-     (vs)->subauth == VNC_AUTH_VENCRYPT_X509PLAIN ||  \
-     (vs)->subauth == VNC_AUTH_VENCRYPT_X509SASL)
 #endif
 
 void vncws_handshake_read(void *opaque)
@@ -105,7 +100,7 @@
     if (!vs->vd->want_tls)
         return vncws_handshake_read_impl(vs);
 
-    if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
+    if (vnc_tls_client_setup(vs, true) < 0) {
         VNC_DEBUG("Failed to setup TLS\n");
         return 0;
     }
--- xen-4.3.0/tools/qemu-xen/ui/vnc.c
+++ xen-4.3.0.mod/tools/qemu-xen/ui/vnc.c
@@ -3121,7 +3121,11 @@
      */
     if (password) {
 #ifdef CONFIG_VNC_TLS
+#ifdef CONFIG_VNC_WS
+        if (tls && !vs->websocket) {
+#else
         if (tls) {
+#endif
             vs->auth = VNC_AUTH_VENCRYPT;
             if (x509) {
                 VNC_DEBUG("Initializing VNC server with x509 password auth\n");
@@ -3141,7 +3145,11 @@
 #ifdef CONFIG_VNC_SASL
     } else if (sasl) {
 #ifdef CONFIG_VNC_TLS
+#ifdef CONFIG_VNC_WS
+        if (tls && !vs->websocket) {
+#else
         if (tls) {
+#endif
             vs->auth = VNC_AUTH_VENCRYPT;
             if (x509) {
                 VNC_DEBUG("Initializing VNC server with x509 SASL auth\n");
@@ -3161,7 +3169,11 @@
 #endif /* CONFIG_VNC_SASL */
     } else {
 #ifdef CONFIG_VNC_TLS
+#ifdef CONFIG_VNC_WS
+        if (tls && !vs->websocket) {
+#else
         if (tls) {
+#endif
             vs->auth = VNC_AUTH_VENCRYPT;
             if (x509) {
                 VNC_DEBUG("Initializing VNC server with x509 no auth\n");