[Development] Use enhanced Security class by both UNIX and Windows viewers.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4042 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index 692fac4..ac3c35e 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -32,15 +32,16 @@
static LogWriter vlog("CConnection");
CConnection::CConnection()
- : is(0), os(0), reader_(0), writer_(0),
- shared(false), security(0), nSecTypes(0), clientSecTypeOrder(false),
+ : csecurity(0), is(0), os(0), reader_(0), writer_(0),
+ shared(false), nSecTypes(0), clientSecTypeOrder(false),
state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false)
{
+ security = new Security();
}
CConnection::~CConnection()
{
- if (security) security->destroy();
+ if (csecurity) csecurity->destroy();
deleteReaderAndWriter();
}
@@ -196,14 +197,14 @@
}
state_ = RFBSTATE_SECURITY;
- security = getCSecurity(secType);
+ csecurity = security->GetCSecurity(secType);
processSecurityMsg();
}
void CConnection::processSecurityMsg()
{
vlog.debug("processing security message");
- if (security->processMsg(this)) {
+ if (csecurity->processMsg(this)) {
state_ = RFBSTATE_SECURITY_RESULT;
processSecurityResultMsg();
}
@@ -213,7 +214,7 @@
{
vlog.debug("processing security result message");
int result;
- if (cp.beforeVersion(3,8) && security->getType() == secTypeNone) {
+ if (cp.beforeVersion(3,8) && csecurity->getType() == secTypeNone) {
result = secResultOK;
} else {
if (!is->checkNoWait(1)) return;