#include <rdr/InStream.h>\r
#include <rdr/OutStream.h>\r
#include <rfb/CConnection.h>\r
-#include <rfb/CSecurityTLS.h>\r
#include <rfb/CSecurityVeNCrypt.h>\r
-#include <rfb/CSecurityVncAuth.h>\r
#include <rfb/LogWriter.h>\r
#include <list>\r
\r
if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt)\r
throw AuthFailureException("No valid VeNCrypt sub-type");\r
\r
- csecurity = CSecurityVeNCrypt::getCSecurityStack(chosenType);\r
+ csecurity = security->GetCSecurity(chosenType);\r
\r
/* send chosen type to server */\r
os->writeU32(chosenType);\r
return csecurity->processMsg(cc);\r
}\r
\r
-CSecurityStack* CSecurityVeNCrypt::getCSecurityStack(int secType)\r
-{\r
- switch (secType) {\r
- case secTypeTLSNone:\r
- return new CSecurityStack(secTypeTLSNone, "TLS with no password",\r
- new CSecurityTLS());\r
- case secTypeTLSVnc:\r
- return new CSecurityStack(secTypeTLSVnc, "TLS with VNCAuth",\r
- new CSecurityTLS(), new CSecurityVncAuth());\r
-#if 0\r
- /* Following subtypes are not implemented, yet */\r
- case secTypeTLSPlain:\r
- case secTypeX509None:\r
- case secTypeX509Vnc:\r
- case secTypeX509Plain:\r
-#endif\r
- default:\r
- throw Exception("Unsupported VeNCrypt subtype");\r
- }\r
-\r
- return NULL; /* not reached */\r
-}\r
#define __CSECURITYVENCRYPT_H__\r
\r
#include <rfb/CSecurity.h>\r
-#include <rfb/CSecurityStack.h>\r
#include <rfb/Security.h>\r
#include <rdr/types.h>\r
\r
\r
static StringParameter secTypesStr;\r
protected:\r
- static CSecurityStack* getCSecurityStack(int secType);\r
-\r
CSecurity *csecurity;\r
Security *security;\r
bool haveRecvdMajorVersion;\r
noinst_LTLIBRARIES = librfb.la
-VENCRYPT_HDRS = CSecurityStack.h CSecurityTLS.h CSecurityTLSBase.h \
- CSecurityVeNCrypt.h SSecurityPlain.h SSecurityStack.h SSecurityTLS.h \
- SSecurityTLSBase.h SSecurityVeNCrypt.h
+VENCRYPT_HDRS = CSecurityTLS.h CSecurityTLSBase.h \
+ SSecurityTLS.h SSecurityTLSBase.h
-VENCRYPT_SRCS = CSecurityStack.cxx CSecurityTLS.cxx CSecurityTLSBase.cxx \
- CSecurityVeNCrypt.cxx SSecurityPlain.cxx SSecurityStack.cxx \
- SSecurityTLS.cxx SSecurityTLSBase.cxx SSecurityVeNCrypt.cxx
+VENCRYPT_SRCS = CSecurityTLS.cxx CSecurityTLSBase.cxx \
+ SSecurityTLS.cxx SSecurityTLSBase.cxx
HDRS = Blacklist.h CapsContainer.h CapsList.h CConnection.h \
CMsgHandler.h CMsgReader.h CMsgReaderV3.h CMsgWriter.h \
CMsgWriterV3.h ColourCube.h ColourMap.h ComparingUpdateTracker.h \
Configuration.h ConnParams.h CSecurity.h CSecurityNone.h \
+ CSecurityStack.h CSecurityVeNCrypt.h \
CSecurityVncAuth.h Cursor.h Decoder.h d3des.h Encoder.h \
encodings.h Exception.h hextileConstants.h hextileDecode.h \
HextileDecoder.h hextileEncodeBetter.h hextileEncode.h \
ScaledPixelBuffer.h ScaleFilters.h SConnection.h ScreenSet.h \
screenTypes.h SDesktop.h ServerCore.h SMsgHandler.h SMsgReader.h \
SMsgReaderV3.h SMsgWriter.h SMsgWriterV3.h SSecurity.h SSecurityNone.h \
+ SSecurityPlain.h SSecurityStack.h SSecurityVeNCrypt.h \
SSecurityVncAuth.h Threading.h tightDecode.h \
TightDecoder.h tightEncode.h TightEncoder.h TightPalette.h Timer.h \
TransImageGetter.h transInitTempl.h transTempl.h TrueColourMap.h \
librfb_la_SOURCES = $(HDRS) Blacklist.cxx CConnection.cxx CMsgHandler.cxx \
CMsgReader.cxx CMsgReaderV3.cxx CMsgWriter.cxx CMsgWriterV3.cxx \
+ CSecurityStack.cxx CSecurityVeNCrypt.cxx \
CSecurityVncAuth.cxx CapsContainer.cxx CapsList.cxx \
ComparingUpdateTracker.cxx Configuration.cxx ConnParams.cxx \
Cursor.cxx Decoder.cxx d3des.c Encoder.cxx \
RREEncoder.cxx RREDecoder.cxx RawDecoder.cxx RawEncoder.cxx \
Region.cxx SConnection.cxx SMsgHandler.cxx \
SMsgReader.cxx SMsgReaderV3.cxx SMsgWriter.cxx SMsgWriterV3.cxx \
- ServerCore.cxx Security.cxx SSecurityVncAuth.cxx \
+ ServerCore.cxx Security.cxx SSecurityPlain.cxx SSecurityStack.cxx \
+ SSecurityVncAuth.cxx SSecurityVeNCrypt.cxx \
ScaledPixelBuffer.cxx ScaleFilters.cxx Timer.cxx TightDecoder.cxx \
TightEncoder.cxx TightPalette.cxx TransImageGetter.cxx \
UpdateTracker.cxx VNCSConnectionST.cxx \
#include <config.h>\r
#endif\r
\r
-#ifndef HAVE_GNUTLS\r
-#error "This source should not be compiled without HAVE_GNUTLS defined"\r
-#endif\r
-\r
#include <rfb/SSecurityPlain.h>\r
#include <rfb/SConnection.h>\r
#include <rfb/Exception.h>\r
#include <config.h>\r
#endif\r
\r
-#ifndef HAVE_GNUTLS\r
-#error "This header should not be included without HAVE_GNUTLS defined"\r
-#endif\r
-\r
#include <rfb/SConnection.h>\r
#include <rfb/SSecurity.h>\r
#include <rfb/SSecurityVeNCrypt.h>\r
#include <config.h>\r
#endif\r
\r
-#ifndef HAVE_GNUTLS\r
-#error "This source should not be compiled without HAVE_GNUTLS defined"\r
-#endif\r
-\r
#include <rfb/SSecurityVeNCrypt.h>\r
#include <rfb/Exception.h>\r
#include <rfb/LogWriter.h>\r
#include <rdr/InStream.h>\r
#include <rdr/OutStream.h>\r
-#include <rfb/SSecurityVncAuth.h>\r
-#include <rfb/SSecurityTLS.h>\r
\r
using namespace rfb;\r
using namespace rdr;\r
if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt)\r
throw AuthFailureException("No valid VeNCrypt sub-type");\r
\r
- ssecurity = SSecurityVeNCrypt::getSSecurityStack(chosenType);\r
+ ssecurity = security->GetSSecurity(chosenType);\r
}\r
\r
/* continue processing the messages */\r
return ssecurity->processMsg(sc);\r
}\r
\r
-SSecurityStack* SSecurityVeNCrypt::getSSecurityStack(int secType)\r
-{\r
- switch (secType) {\r
- case secTypeTLSNone:\r
- return new SSecurityStack(secTypeTLSNone, new SSecurityTLS());\r
- case secTypeTLSVnc:\r
- return new SSecurityStack(secTypeTLSVnc, new SSecurityTLS(), new SSecurityVncAuth());\r
-#if 0\r
- /* Following types are not implemented, yet */\r
- case secTypeTLSPlain:\r
- case secTypeX509None:\r
- case secTypeX509Vnc:\r
- case secTypeX509Plain:\r
-#endif\r
- default:\r
- throw Exception("Bug in the SSecurityVeNCrypt::getSSecurityStack");\r
- }\r
-}\r
-\r
#include <config.h>\r
#endif\r
\r
-#ifndef HAVE_GNUTLS\r
-#error "This header should not be included without HAVE_GNUTLS defined"\r
-#endif\r
-\r
#include <rfb/SSecurityStack.h>\r
#include <rfb/SConnection.h>\r
\r
static StringParameter X509_CertFile, X509_KeyFile;\r
\r
protected:\r
- static SSecurityStack* getSSecurityStack(int secType);\r
-\r
SSecurity *ssecurity;\r
Security *security;\r
bool haveSentVersion, haveRecvdMajorVersion, haveRecvdMinorVersion;\r
#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>
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
}
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
}