aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CSecurityVeNCrypt.cxx
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2010-07-20 15:14:50 +0000
committerAdam Tkac <atkac@redhat.com>2010-07-20 15:14:50 +0000
commit814fa8972e130777d2465d63f57ac7029e2d9ec1 (patch)
tree9de67dc8d1338109f40a54bc325638c3518e01bc /common/rfb/CSecurityVeNCrypt.cxx
parenta032593f99497cc9394ca7cfb8b96301100ef7a5 (diff)
downloadtigervnc-814fa8972e130777d2465d63f57ac7029e2d9ec1.tar.gz
tigervnc-814fa8972e130777d2465d63f57ac7029e2d9ec1.zip
[Development] Use SecurityType also as configuration for VeNCrypt.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4102 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/CSecurityVeNCrypt.cxx')
-rw-r--r--common/rfb/CSecurityVeNCrypt.cxx29
1 files changed, 9 insertions, 20 deletions
diff --git a/common/rfb/CSecurityVeNCrypt.cxx b/common/rfb/CSecurityVeNCrypt.cxx
index 94af48d5..39a95f44 100644
--- a/common/rfb/CSecurityVeNCrypt.cxx
+++ b/common/rfb/CSecurityVeNCrypt.cxx
@@ -30,7 +30,6 @@
#include <rfb/CSecurityVeNCrypt.h>
#include <rfb/CSecurityVncAuth.h>
#include <rfb/LogWriter.h>
-#include <rfb/SSecurityVeNCrypt.h>
#include <list>
using namespace rfb;
@@ -147,14 +146,14 @@ bool CSecurityVeNCrypt::processMsg(CConnection* cc)
/* make a choice and send it to the server, meanwhile set up the stack */
if (!haveChosenType) {
- chosenType = 0;
+ chosenType = secTypeInvalid;
U8 i;
list<U32>::iterator j;
list<U32> preferredList;
/* Try preferred choice */
- SSecurityVeNCrypt::getSecTypes(&preferredList);
-
+ preferredList = security->GetEnabledExtSecTypes();
+
for (j = preferredList.begin(); j != preferredList.end(); j++) {
for (i = 0; i < nAvailableTypes; i++) {
if (*j == availableTypes[i]) {
@@ -163,29 +162,19 @@ bool CSecurityVeNCrypt::processMsg(CConnection* cc)
}
}
- if (chosenType)
+ if (chosenType != secTypeInvalid)
break;
}
vlog.debug("Choosing security type %s (%d)", secTypeName(chosenType),
chosenType);
+
/* Set up the stack according to the chosen type: */
- switch (chosenType) {
- case secTypeTLSNone:
- case secTypeTLSVnc:
- case secTypeTLSPlain:
- case secTypeX509None:
- case secTypeX509Vnc:
- case secTypeX509Plain:
- csecurity = CSecurityVeNCrypt::getCSecurityStack(chosenType);
- break;
+ if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt)
+ throw AuthFailureException("No valid VeNCrypt sub-type");
+
+ csecurity = CSecurityVeNCrypt::getCSecurityStack(chosenType);
- case secTypeInvalid:
- case secTypeVeNCrypt: /* would cause looping */
- default:
- throw AuthFailureException("No valid VeNCrypt sub-type");
- }
-
/* send chosen type to server */
os->writeU32(chosenType);
os->flush();