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