From a032593f99497cc9394ca7cfb8b96301100ef7a5 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Tue, 20 Jul 2010 15:14:08 +0000 Subject: [PATCH] [Development] Pass Security instance to {C,S}SecurityVeNCrypt. Signed-off-by: Martin Koegler git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4101 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/CSecurityVeNCrypt.cxx | 2 +- common/rfb/CSecurityVeNCrypt.h | 3 ++- common/rfb/SSecurityVeNCrypt.cxx | 2 +- common/rfb/SSecurityVeNCrypt.h | 3 ++- common/rfb/Security.cxx | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/rfb/CSecurityVeNCrypt.cxx b/common/rfb/CSecurityVeNCrypt.cxx index 87b81b60..94af48d5 100644 --- a/common/rfb/CSecurityVeNCrypt.cxx +++ b/common/rfb/CSecurityVeNCrypt.cxx @@ -39,7 +39,7 @@ using namespace std; static LogWriter vlog("CVeNCrypt"); -CSecurityVeNCrypt::CSecurityVeNCrypt(void) : csecurity(NULL) +CSecurityVeNCrypt::CSecurityVeNCrypt(Security* sec) : csecurity(NULL), security(sec) { haveRecvdMajorVersion = false; haveRecvdMinorVersion = false; diff --git a/common/rfb/CSecurityVeNCrypt.h b/common/rfb/CSecurityVeNCrypt.h index 7280546a..3ad6eb2c 100644 --- a/common/rfb/CSecurityVeNCrypt.h +++ b/common/rfb/CSecurityVeNCrypt.h @@ -35,7 +35,7 @@ namespace rfb { class CSecurityVeNCrypt : public CSecurity { public: - CSecurityVeNCrypt(void); + CSecurityVeNCrypt(Security* sec); ~CSecurityVeNCrypt(); virtual bool processMsg(CConnection* cc);// { return true; } int getType() const {return chosenType;} @@ -46,6 +46,7 @@ namespace rfb { static CSecurityStack* getCSecurityStack(int secType); CSecurity *csecurity; + Security *security; bool haveRecvdMajorVersion; bool haveRecvdMinorVersion; bool haveSentVersion; diff --git a/common/rfb/SSecurityVeNCrypt.cxx b/common/rfb/SSecurityVeNCrypt.cxx index b1365998..894118db 100644 --- a/common/rfb/SSecurityVeNCrypt.cxx +++ b/common/rfb/SSecurityVeNCrypt.cxx @@ -60,7 +60,7 @@ StringParameter SSecurityVeNCrypt::secTypesStr "TLSVnc, TLSPlain, X509None, X509Vnc, X509Plain)", "TLSVnc,TLSPlain,X509Vnc,X509Plain"); -SSecurityVeNCrypt::SSecurityVeNCrypt(void) +SSecurityVeNCrypt::SSecurityVeNCrypt(Security *sec) : security(sec) { ssecurity = NULL; haveSentVersion = false; diff --git a/common/rfb/SSecurityVeNCrypt.h b/common/rfb/SSecurityVeNCrypt.h index cbbcb7fe..1fd6b4a0 100644 --- a/common/rfb/SSecurityVeNCrypt.h +++ b/common/rfb/SSecurityVeNCrypt.h @@ -40,7 +40,7 @@ namespace rfb { class SSecurityVeNCrypt : public SSecurity { public: - SSecurityVeNCrypt(void); + SSecurityVeNCrypt(Security *sec); ~SSecurityVeNCrypt(); virtual bool processMsg(SConnection* sc);// { return true; } virtual int getType() const { return secTypeVeNCrypt; } @@ -57,6 +57,7 @@ namespace rfb { static SSecurityStack* getSSecurityStack(int secType); SSecurity *ssecurity; + Security *security; bool haveSentVersion, haveRecvdMajorVersion, haveRecvdMinorVersion; bool haveSentTypes, haveChosenType; rdr::U8 majorVersion, minorVersion, numTypes; diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx index cc4889a7..4dea41ea 100644 --- a/common/rfb/Security.cxx +++ b/common/rfb/Security.cxx @@ -117,7 +117,7 @@ SSecurity* Security::GetSSecurity(U32 secType) case secTypeNone: return new SSecurityNone(); case secTypeVncAuth: return new SSecurityVncAuth(); #ifdef HAVE_GNUTLS - case secTypeVeNCrypt: return new SSecurityVeNCrypt(); + case secTypeVeNCrypt: return new SSecurityVeNCrypt(this); #endif } @@ -136,7 +136,7 @@ CSecurity* Security::GetCSecurity(U32 secType) case secTypeNone: return new CSecurityNone(); case secTypeVncAuth: return new CSecurityVncAuth(); #ifdef HAVE_GNUTLS - case secTypeVeNCrypt: return new CSecurityVeNCrypt(); + case secTypeVeNCrypt: return new CSecurityVeNCrypt(this); #endif } -- 2.39.5