]> git.proxmox.com Git - pve-qemu-kvm.git/blame - debian/patches/vencrypt-auth-plain.patch
Two more fixes
[pve-qemu-kvm.git] / debian / patches / vencrypt-auth-plain.patch
CommitLineData
7b68d5de
DM
1Index: new/ui/vnc-auth-vencrypt.c
2===================================================================
3fe80761
DM
3--- new.orig/ui/vnc-auth-vencrypt.c 2014-07-16 12:01:28.000000000 +0200
4+++ new/ui/vnc-auth-vencrypt.c 2014-07-16 12:01:28.000000000 +0200
b0a57099 5@@ -144,6 +144,11 @@
4e76d234
AD
6 vnc_read_when(vs, protocol_client_auth_plain_start, 8);
7 break;
8
9+ case VNC_AUTH_VENCRYPT_PLAIN:
10+ VNC_DEBUG("Start auth PLAIN\n");
11+ vnc_read_when(vs, protocol_client_auth_plain_start, 8);
12+ break;
13+
14 case VNC_AUTH_VENCRYPT_TLSVNC:
15 case VNC_AUTH_VENCRYPT_X509VNC:
16 VNC_DEBUG("Start TLS auth VNC\n");
b0a57099 17@@ -228,25 +233,32 @@
4e76d234
AD
18 {
19 int auth = read_u32(data, 0);
20
21- if (auth != vs->subauth) {
22+ if (auth != vs->subauth && auth != VNC_AUTH_VENCRYPT_PLAIN) {
23 VNC_DEBUG("Rejecting auth %d\n", auth);
24 vnc_write_u8(vs, 0); /* Reject auth */
25 vnc_flush(vs);
26 vnc_client_error(vs);
27 } else {
28- VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);
29- vnc_write_u8(vs, 1); /* Accept auth */
30- vnc_flush(vs);
31-
32- if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
33- VNC_DEBUG("Failed to setup TLS\n");
34- return 0;
35+ if (auth == VNC_AUTH_VENCRYPT_PLAIN) {
7b68d5de 36+ vs->subauth = auth;
4e76d234
AD
37+ start_auth_vencrypt_subauth(vs);
38 }
39-
40- VNC_DEBUG("Start TLS VeNCrypt handshake process\n");
41- if (vnc_start_vencrypt_handshake(vs) < 0) {
42- VNC_DEBUG("Failed to start TLS handshake\n");
43- return 0;
44+ else
45+ {
46+ VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);
47+ vnc_write_u8(vs, 1); /* Accept auth */
7b68d5de 48+ vnc_flush(vs);
4e76d234
AD
49+
50+ if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
51+ VNC_DEBUG("Failed to setup TLS\n");
52+ return 0;
53+ }
54+
55+ VNC_DEBUG("Start TLS VeNCrypt handshake process\n");
56+ if (vnc_start_vencrypt_handshake(vs) < 0) {
57+ VNC_DEBUG("Failed to start TLS handshake\n");
58+ return 0;
59+ }
60 }
61 }
62 return 0;
b0a57099 63@@ -261,10 +273,11 @@
4e76d234
AD
64 vnc_flush(vs);
65 vnc_client_error(vs);
66 } else {
67- VNC_DEBUG("Sending allowed auth %d\n", vs->subauth);
68+ VNC_DEBUG("Sending allowed auths %d %d\n", vs->subauth, VNC_AUTH_VENCRYPT_PLAIN);
69 vnc_write_u8(vs, 0); /* Accept version */
70- vnc_write_u8(vs, 1); /* Number of sub-auths */
71+ vnc_write_u8(vs, 2); /* Number of sub-auths */
72 vnc_write_u32(vs, vs->subauth); /* The supported auth */
73+ vnc_write_u32(vs, VNC_AUTH_VENCRYPT_PLAIN); /* Alternative supported auth */
74 vnc_flush(vs);
75 vnc_read_when(vs, protocol_client_vencrypt_auth, 4);
76 }