summaryrefslogtreecommitdiffstats
path: root/rfb/rfbclient.h
diff options
context:
space:
mode:
authorVic Lee <llyzs@163.com>2009-10-01 20:22:36 +0800
committerJohannes Schindelin <johannes.schindelin@gmx.de>2009-10-02 11:52:05 +0200
commit58a8df6ff2bffa46d96b057603c93d824f1c8591 (patch)
tree22b343f454cd04530de84d42320aa1d390a602ea /rfb/rfbclient.h
parent0c061f2a2757384fb4f43c2462f649a1ba5a6c9e (diff)
downloadlibtdevnc-58a8df6ff2bffa46d96b057603c93d824f1c8591.tar.gz
libtdevnc-58a8df6ff2bffa46d96b057603c93d824f1c8591.zip
Add anonymous TLS support in libvncclient
Signed-off-by: Vic Lee <llyzs@163.com>
Diffstat (limited to 'rfb/rfbclient.h')
-rw-r--r--rfb/rfbclient.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index 07da7df..b3a0d87 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -33,6 +33,9 @@
#include <unistd.h>
#include <rfb/rfbproto.h>
#include <rfb/keysym.h>
+#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
+#include <gnutls/gnutls.h>
+#endif
#define rfbClientSwap16IfLE(s) \
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
@@ -98,6 +101,24 @@ typedef struct {
int scaleSetting; /* 0 means no scale set, else 1/scaleSetting */
} AppData;
+/* For GetCredentialProc callback function to return */
+typedef union _rfbCredential
+{
+ /* VeNCrypt */
+ struct
+ {
+ char *x509CACertFile;
+ char *x509CACrlFile;
+ char *x509ClientCertFile;
+ char *x509ClientKeyFile;
+ } x509Credential;
+ /* MSLogon */
+ struct
+ {
+ char *username;
+ char *password;
+ } userCredential;
+} rfbCredential;
struct _rfbClient;
@@ -108,6 +129,7 @@ typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y,
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
+typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, uint8_t securityType);
typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen);
typedef void (*BellProc)(struct _rfbClient* client);
@@ -249,6 +271,22 @@ typedef struct _rfbClient {
/* negotiated protocol version */
int major, minor;
+
+ /* The selected security types */
+ uint32_t authScheme, subAuthScheme;
+
+#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
+ /* The TLS session for Anonymous TLS and VeNCrypt */
+ gnutls_session_t tlsSession;
+#endif
+
+ /* To support security types that requires user input (except VNC password
+ * authentication), for example VeNCrypt and MSLogon, this callback function
+ * must be set before the authentication. Otherwise, it implicates that the
+ * caller application does not support it and related security types should
+ * be bypassed.
+ */
+ GetCredentialProc GetCredential;
} rfbClient;
/* cursor.c */