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
6 vnc_read_when(vs, protocol_client_auth_plain_start, 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);
14 case VNC_AUTH_VENCRYPT_TLSVNC:
15 case VNC_AUTH_VENCRYPT_X509VNC:
16 VNC_DEBUG("Start TLS auth VNC\n");
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 */
28 - VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);
29 - vnc_write_u8(vs, 1); /* Accept auth */
32 - if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
33 - VNC_DEBUG("Failed to setup TLS\n");
35 + if (auth == VNC_AUTH_VENCRYPT_PLAIN) {
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");
46 + VNC_DEBUG("Accepting auth %d, setting up TLS for handshake\n", auth);
47 + vnc_write_u8(vs, 1); /* Accept auth */
50 + if (vnc_tls_client_setup(vs, NEED_X509_AUTH(vs)) < 0) {
51 + VNC_DEBUG("Failed to setup TLS\n");
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");
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 */
75 vnc_read_when(vs, protocol_client_vencrypt_auth, 4);