[Development] Create VeNCrypt security types in Security class.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4103 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx
index 4dea41e..e6a51bc 100644
--- a/common/rfb/Security.cxx
+++ b/common/rfb/Security.cxx
@@ -28,15 +28,19 @@
 #define strcasecmp _stricmp
 #endif
 #include <rfb/CSecurityNone.h>
+#include <rfb/CSecurityStack.h>
 #include <rfb/CSecurityVeNCrypt.h>
 #include <rfb/CSecurityVncAuth.h>
 #include <rdr/Exception.h>
 #include <rfb/LogWriter.h>
 #include <rfb/Security.h>
 #include <rfb/SSecurityNone.h>
+#include <rfb/SSecurityStack.h>
 #include <rfb/SSecurityVncAuth.h>
-#ifdef HAVE_GNUTLS
 #include <rfb/SSecurityVeNCrypt.h>
+#ifdef HAVE_GNUTLS
+#include <rfb/CSecurityTLS.h>
+#include <rfb/SSecurityTLS.h>
 #endif
 #include <rfb/util.h>
 
@@ -116,8 +120,12 @@
   switch (secType) {
   case secTypeNone: return new SSecurityNone();
   case secTypeVncAuth: return new SSecurityVncAuth();
-#ifdef HAVE_GNUTLS
   case secTypeVeNCrypt: return new SSecurityVeNCrypt(this);
+#ifdef HAVE_GNUTLS
+  case secTypeTLSNone:
+    return new SSecurityStack(secTypeTLSNone, new SSecurityTLS());
+  case secTypeTLSVnc:
+    return new SSecurityStack(secTypeTLSVnc, new SSecurityTLS(), new SSecurityVncAuth());
 #endif
   }
 
@@ -135,8 +143,14 @@
   switch (secType) {
   case secTypeNone: return new CSecurityNone();
   case secTypeVncAuth: return new CSecurityVncAuth();
-#ifdef HAVE_GNUTLS
   case secTypeVeNCrypt: return new CSecurityVeNCrypt(this);
+#ifdef HAVE_GNUTLS
+  case secTypeTLSNone:
+    return new CSecurityStack(secTypeTLSNone, "TLS with no password",
+			      new CSecurityTLS());
+  case secTypeTLSVnc:
+    return new CSecurityStack(secTypeTLSVnc, "TLS with VNCAuth",
+			      new CSecurityTLS(), new CSecurityVncAuth());
 #endif
   }