diff options
author | Adam Tkac <atkac@redhat.com> | 2010-08-12 14:17:28 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2010-08-12 14:17:28 +0000 |
commit | fb993153a026e5bfa3e7f87a34ca7155aea555d3 (patch) | |
tree | 615bb6d44ffb99579ecc09d40d8905d7b5f66c6e /common | |
parent | 95e2fe875860954c17a98920537e4d40b0805c9e (diff) | |
download | tigervnc-fb993153a026e5bfa3e7f87a34ca7155aea555d3.tar.gz tigervnc-fb993153a026e5bfa3e7f87a34ca7155aea555d3.zip |
[Development] Extend Security class to allow different default sectypes for server/viewer.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4122 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/CConnection.cxx | 2 | ||||
-rw-r--r-- | common/rfb/SConnection.cxx | 2 | ||||
-rw-r--r-- | common/rfb/Security.cxx | 22 | ||||
-rw-r--r-- | common/rfb/Security.h | 7 |
4 files changed, 25 insertions, 8 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index 7aa38d9e..6e1bf123 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -36,7 +36,7 @@ CConnection::CConnection() shared(false), state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false) { - security = new Security(); + security = new Security(SecurityViewer); } CConnection::~CConnection() diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index 0e6ded52..87db2001 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -55,7 +55,7 @@ SConnection::SConnection(bool reverseConnection_) cp.setVersion(defaultMajorVersion, defaultMinorVersion); - security = new Security(); + security = new Security(SecurityServer); } SConnection::~SConnection() diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx index 41029204..600df14d 100644 --- a/common/rfb/Security.cxx +++ b/common/rfb/Security.cxx @@ -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); diff --git a/common/rfb/Security.h b/common/rfb/Security.h index 54cdb80e..6ee6b615 100644 --- a/common/rfb/Security.h +++ b/common/rfb/Security.h @@ -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 |