set correct version in control
[vncterm.git] / vncpatches / tls-auth-pluging.patch
CommitLineData
e6d0212c
DM
1Index: vnc/libvncserver/auth.c
2===================================================================
3@@ -270,8 +270,9 @@
4 int32_t securityType = rfbSecTypeInvalid;
5
6 if (!cl->screen->authPasswdData || cl->reverseConnection) {
7- /* chk if this condition is valid or not. */
8- securityType = rfbSecTypeNone;
9+ /* chk if this condition is valid or not. */
10+ /* we disable anonymous auth */
11+ // securityType = rfbSecTypeNone;
12 } else if (cl->screen->authPasswdData) {
13 securityType = rfbSecTypeVncAuth;
14 }
15Index: vnc/newterm/Makefile.am
16Index: vnc/libvncserver/sockets.c
17===================================================================
18--- vnc.orig/libvncserver/sockets.c 2011-01-20 16:42:41.000000000 +0100
19+++ vnc/libvncserver/sockets.c 2011-01-21 10:20:03.000000000 +0100
20@@ -454,8 +454,12 @@
21 fd_set fds;
22 struct timeval tv;
23
24+
25 while (len > 0) {
26- n = read(sock, buf, len);
27+ if (cl->sock_read_fn)
28+ n = cl->sock_read_fn(cl, buf, len);
29+ else
30+ n = read(sock, buf, len);
31
32 if (n > 0) {
33
34@@ -538,7 +542,10 @@
35
36 LOCK(cl->outputMutex);
37 while (len > 0) {
38- n = write(sock, buf, len);
39+ if (cl->sock_write_fn)
40+ n = cl->sock_write_fn(cl, buf, len);
41+ else
42+ n = write(sock, buf, len);
43
44 if (n > 0) {
45
46Index: vnc/rfb/rfb.h
47===================================================================
48--- vnc.orig/rfb/rfb.h 2011-01-20 16:36:06.000000000 +0100
49+++ vnc/rfb/rfb.h 2011-01-21 06:44:22.000000000 +0100
50@@ -397,6 +397,9 @@
51 struct _rfbStatList *Next;
52 } rfbStatList;
53
54+typedef ssize_t (*sock_read_fn_t)(struct _rfbClientRec *cl, void *buf, size_t count);
55+typedef ssize_t (*sock_write_fn_t)(struct _rfbClientRec *cl, const void *buf, size_t count);
56+
57 typedef struct _rfbClientRec {
58
59 /* back pointer to the screen */
60@@ -417,6 +420,10 @@
61 void* clientData;
62 ClientGoneHookPtr clientGoneHook;
63
64+ /* use to hook up TLS read/write */
65+ sock_read_fn_t sock_read_fn;
66+ sock_read_fn_t sock_write_fn;
67+
68 SOCKET sock;
69 char *host;
70