clean: remove buildinfo/changes
[pve-qemu-kvm.git] / debian / patches / old / vencrypt-auth-plain.patch
blobc9d45029a17443289439c3b8d9b211b86510379f
1 Index: new/ui/vnc-auth-vencrypt.c
2 ===================================================================
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
5 @@ -144,6 +144,11 @@
6 vnc_read_when(vs, protocol_client_auth_plain_start, 8);
7 break;
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;
14 case VNC_AUTH_VENCRYPT_TLSVNC:
15 case VNC_AUTH_VENCRYPT_X509VNC:
16 VNC_DEBUG("Start TLS auth VNC\n");
17 @@ -228,25 +233,32 @@
19 int auth = read_u32(data, 0);
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);
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) {
36 + vs->subauth = auth;
37 + start_auth_vencrypt_subauth(vs);
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 */
48 + vnc_flush(vs);
50 + if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
51 + VNC_DEBUG("Failed to setup TLS\n");
52 + return 0;
53 + }
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 + }
62 return 0;
63 @@ -261,10 +273,11 @@
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);