]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] Extend Security class to allow different default sectypes for server...
authorAdam Tkac <atkac@redhat.com>
Thu, 12 Aug 2010 14:17:28 +0000 (14:17 +0000)
committerAdam Tkac <atkac@redhat.com>
Thu, 12 Aug 2010 14:17:28 +0000 (14:17 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4122 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/CConnection.cxx
common/rfb/SConnection.cxx
common/rfb/Security.cxx
common/rfb/Security.h

index 7aa38d9e4fd19a5f6539ceb58a78a1bfcaa9ad53..6e1bf12316f221d4cb43c8dcee46b4f9c2a3e1f4 100644 (file)
@@ -36,7 +36,7 @@ CConnection::CConnection()
     shared(false),
     state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false)
 {
-  security = new Security();
+  security = new Security(SecurityViewer);
 }
 
 CConnection::~CConnection()
index 0e6ded52d6649accdafb110ae0315db8cfe94876..87db20015b38622f1f89ab300bac3888ad5c4d62 100644 (file)
@@ -55,7 +55,7 @@ SConnection::SConnection(bool reverseConnection_)
 
   cp.setVersion(defaultMajorVersion, defaultMinorVersion);
 
-  security = new Security();
+  security = new Security(SecurityServer);
 }
 
 SConnection::~SConnection()
index 4102920427a8b08334c377ea2e185c8839c6668c..600df14db67617752ed7dcfd3bf2b4ebaad1ef0b 100644 (file)
@@ -52,14 +52,28 @@ static LogWriter vlog("Security");
 
 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);
 
index 54cdb80e4b203aef177a83d10078daa8ed844a2e..6ee6b615e937b529f39706a6d08b592766d8417b 100644 (file)
@@ -60,12 +60,14 @@ namespace rfb {
   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.
@@ -94,7 +96,8 @@ namespace rfb {
     /* 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