[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/SSecurityVeNCrypt.cxx b/common/rfb/SSecurityVeNCrypt.cxx
index 2dd331e..c704d1e 100644
--- a/common/rfb/SSecurityVeNCrypt.cxx
+++ b/common/rfb/SSecurityVeNCrypt.cxx
@@ -26,17 +26,11 @@
#include <config.h>
#endif
-#ifndef HAVE_GNUTLS
-#error "This source should not be compiled without HAVE_GNUTLS defined"
-#endif
-
#include <rfb/SSecurityVeNCrypt.h>
#include <rfb/Exception.h>
#include <rfb/LogWriter.h>
#include <rdr/InStream.h>
#include <rdr/OutStream.h>
-#include <rfb/SSecurityVncAuth.h>
-#include <rfb/SSecurityTLS.h>
using namespace rfb;
using namespace rdr;
@@ -180,29 +174,10 @@
if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt)
throw AuthFailureException("No valid VeNCrypt sub-type");
- ssecurity = SSecurityVeNCrypt::getSSecurityStack(chosenType);
+ ssecurity = security->GetSSecurity(chosenType);
}
/* continue processing the messages */
return ssecurity->processMsg(sc);
}
-SSecurityStack* SSecurityVeNCrypt::getSSecurityStack(int secType)
-{
- switch (secType) {
- case secTypeTLSNone:
- return new SSecurityStack(secTypeTLSNone, new SSecurityTLS());
- case secTypeTLSVnc:
- return new SSecurityStack(secTypeTLSVnc, new SSecurityTLS(), new SSecurityVncAuth());
-#if 0
- /* Following types are not implemented, yet */
- case secTypeTLSPlain:
- case secTypeX509None:
- case secTypeX509Vnc:
- case secTypeX509Plain:
-#endif
- default:
- throw Exception("Bug in the SSecurityVeNCrypt::getSSecurityStack");
- }
-}
-