bump version to 1.7-1
[vncterm.git] / vncpatches / tls-auth-pluging.patch
CommitLineData
648c78ad 1Index: libvncserver-LibVNCServer-0.9.13/libvncserver/auth.c
e6d0212c 2===================================================================
648c78ad
FG
3--- libvncserver-LibVNCServer-0.9.13.orig/libvncserver/auth.c
4+++ libvncserver-LibVNCServer-0.9.13/libvncserver/auth.c
5@@ -301,7 +301,8 @@ rfbAuthNewClient(rfbClientPtr cl)
e6d0212c
DM
6
7 if (!cl->screen->authPasswdData || cl->reverseConnection) {
648c78ad 8 /* chk if this condition is valid or not. */
e6d0212c 9- securityType = rfbSecTypeNone;
c8d35ad9
FG
10+ /* we disable anonymous auth */
11+ // securityType = rfbSecTypeNone;
e6d0212c
DM
12 } else if (cl->screen->authPasswdData) {
13 securityType = rfbSecTypeVncAuth;
14 }
648c78ad 15Index: libvncserver-LibVNCServer-0.9.13/libvncserver/sockets.c
e6d0212c 16===================================================================
648c78ad
FG
17--- libvncserver-LibVNCServer-0.9.13.orig/libvncserver/sockets.c
18+++ libvncserver-LibVNCServer-0.9.13/libvncserver/sockets.c
19@@ -638,7 +638,11 @@ rfbReadExactTimeout(rfbClientPtr cl, cha
c8d35ad9
FG
20 n = read(sock, buf, len);
21 }
22 #else
e6d0212c 23- n = read(sock, buf, len);
c8d35ad9
FG
24+ if (cl->sock_read_fn) {
25+ n = cl->sock_read_fn(cl, buf, len);
26+ } else {
27+ n = read(sock, buf, len);
28+ }
29 #endif
e6d0212c
DM
30
31 if (n > 0) {
648c78ad 32@@ -826,7 +830,11 @@ rfbWriteExact(rfbClientPtr cl,
c8d35ad9
FG
33 n = rfbssl_write(cl, buf, len);
34 else
35 #endif
36+ if (cl->sock_write_fn) {
e6d0212c 37+ n = cl->sock_write_fn(cl, buf, len);
c8d35ad9
FG
38+ } else {
39 n = write(sock, buf, len);
40+ }
e6d0212c
DM
41
42 if (n > 0) {
43
648c78ad 44Index: libvncserver-LibVNCServer-0.9.13/rfb/rfb.h
e6d0212c 45===================================================================
648c78ad
FG
46--- libvncserver-LibVNCServer-0.9.13.orig/rfb/rfb.h
47+++ libvncserver-LibVNCServer-0.9.13/rfb/rfb.h
48@@ -411,6 +411,9 @@ typedef struct _rfbStatList {
49 typedef struct _rfbSslCtx rfbSslCtx;
50 typedef struct _wsCtx wsCtx;
e6d0212c
DM
51
52+typedef ssize_t (*sock_read_fn_t)(struct _rfbClientRec *cl, void *buf, size_t count);
53+typedef ssize_t (*sock_write_fn_t)(struct _rfbClientRec *cl, const void *buf, size_t count);
54+
55 typedef struct _rfbClientRec {
648c78ad
FG
56
57 /** back pointer to the screen */
58@@ -431,6 +434,10 @@ typedef struct _rfbClientRec {
e6d0212c
DM
59 void* clientData;
60 ClientGoneHookPtr clientGoneHook;
61
62+ /* use to hook up TLS read/write */
63+ sock_read_fn_t sock_read_fn;
64+ sock_read_fn_t sock_write_fn;
65+
648c78ad 66 rfbSocket sock;
e6d0212c
DM
67 char *host;
68