2020-07-14 14:28:37 +03:00
Index: libvncserver-LibVNCServer-0.9.13/libvncserver/auth.c
2011-08-23 09:52:28 +04:00
===================================================================
2020-07-14 14:28:37 +03:00
--- libvncserver-LibVNCServer-0.9.13.orig/libvncserver/auth.c
+++ libvncserver-LibVNCServer-0.9.13/libvncserver/auth.c
@@ -301,7 +301,8 @@ rfbAuthNewClient(rfbClientPtr cl)
2011-08-23 09:52:28 +04:00
if (!cl->screen->authPasswdData || cl->reverseConnection) {
2020-07-14 14:28:37 +03:00
/* chk if this condition is valid or not. */
2011-08-23 09:52:28 +04:00
- securityType = rfbSecTypeNone;
2017-02-02 13:50:14 +03:00
+ /* we disable anonymous auth */
+ // securityType = rfbSecTypeNone;
2011-08-23 09:52:28 +04:00
} else if (cl->screen->authPasswdData) {
securityType = rfbSecTypeVncAuth;
}
2020-07-14 14:28:37 +03:00
Index: libvncserver-LibVNCServer-0.9.13/libvncserver/sockets.c
2011-08-23 09:52:28 +04:00
===================================================================
2020-07-14 14:28:37 +03:00
--- libvncserver-LibVNCServer-0.9.13.orig/libvncserver/sockets.c
+++ libvncserver-LibVNCServer-0.9.13/libvncserver/sockets.c
@@ -638,7 +638,11 @@ rfbReadExactTimeout(rfbClientPtr cl, cha
2017-02-02 13:50:14 +03:00
n = read(sock, buf, len);
}
#else
2011-08-23 09:52:28 +04:00
- n = read(sock, buf, len);
2017-02-02 13:50:14 +03:00
+ if (cl->sock_read_fn) {
+ n = cl->sock_read_fn(cl, buf, len);
+ } else {
+ n = read(sock, buf, len);
+ }
#endif
2011-08-23 09:52:28 +04:00
if (n > 0) {
2020-07-14 14:28:37 +03:00
@@ -826,7 +830,11 @@ rfbWriteExact(rfbClientPtr cl,
2017-02-02 13:50:14 +03:00
n = rfbssl_write(cl, buf, len);
else
#endif
+ if (cl->sock_write_fn) {
2011-08-23 09:52:28 +04:00
+ n = cl->sock_write_fn(cl, buf, len);
2017-02-02 13:50:14 +03:00
+ } else {
n = write(sock, buf, len);
+ }
2011-08-23 09:52:28 +04:00
if (n > 0) {
2020-07-14 14:28:37 +03:00
Index: libvncserver-LibVNCServer-0.9.13/rfb/rfb.h
2011-08-23 09:52:28 +04:00
===================================================================
2020-07-14 14:28:37 +03:00
--- libvncserver-LibVNCServer-0.9.13.orig/rfb/rfb.h
+++ libvncserver-LibVNCServer-0.9.13/rfb/rfb.h
@@ -411,6 +411,9 @@ typedef struct _rfbStatList {
typedef struct _rfbSslCtx rfbSslCtx;
typedef struct _wsCtx wsCtx;
2011-08-23 09:52:28 +04:00
+typedef ssize_t (*sock_read_fn_t)(struct _rfbClientRec *cl, void *buf, size_t count);
+typedef ssize_t (*sock_write_fn_t)(struct _rfbClientRec *cl, const void *buf, size_t count);
+
typedef struct _rfbClientRec {
2020-07-14 14:28:37 +03:00
/** back pointer to the screen */
@@ -431,6 +434,10 @@ typedef struct _rfbClientRec {
2011-08-23 09:52:28 +04:00
void* clientData;
ClientGoneHookPtr clientGoneHook;
+ /* use to hook up TLS read/write */
+ sock_read_fn_t sock_read_fn;
+ sock_read_fn_t sock_write_fn;
+
2020-07-14 14:28:37 +03:00
rfbSocket sock;
2011-08-23 09:52:28 +04:00
char *host;