shared(false),
state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false)
{
- security = new Security();
+ security = new Security(SecurityViewer);
}
CConnection::~CConnection()
cp.setVersion(defaultMajorVersion, defaultMinorVersion);
- security = new Security();
+ security = new Security(SecurityServer);
}
SConnection::~SConnection()
UserPasswdGetter *CSecurity::upg = NULL;
-StringParameter Security::secTypes
+StringParameter Security::secTypesViewer
("SecurityTypes",
"Specify which security scheme to use (None, VncAuth)",
- "VncAuth");
+ "VncAuth", ConfViewer);
-Security::Security(void)
+StringParameter Security::secTypesServer
+("SecurityTypes",
+ "Specify which security scheme to use (None, VncAuth)",
+ "VncAuth", ConfServer);
+
+Security::Security(SecurityClassType secClassType)
{
- char *secTypesStr = secTypes.getData();
+ char *secTypesStr;
+
+ switch (secClassType) {
+ case SecurityViewer:
+ secTypesStr = secTypesViewer.getData();
+ break;
+ case SecurityServer:
+ secTypesStr = secTypesServer.getData();
+ break;
+ };
enabledSecTypes = parseSecTypes(secTypesStr);
const rdr::U32 secResultFailed = 1;
const rdr::U32 secResultTooMany = 2; // deprecated
+ enum SecurityClassType { SecurityViewer, SecurityServer };
+
class Security {
public:
/*
* Create Security instance.
*/
- Security(void);
+ Security(SecurityClassType secClassType);
/*
* Note about security types.
/* Create client side CSecurity class instance */
CSecurity* GetCSecurity(rdr::U32 secType);
- static StringParameter secTypes;
+ static StringParameter secTypesViewer;
+ static StringParameter secTypesServer;
/*
* Use variable directly instead of dumb get/set methods. It is used