git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4110 3789f03b-4d11-0410-bbf8-ca57d06f2519tags/v1.0.90
@@ -27,7 +27,7 @@ | |||
#error "This header should not be compiled without HAVE_GNUTLS defined" | |||
#endif | |||
#include <rfb/CSecurityTLSBase.h> | |||
#include <rfb/CSecurityTLS.h> | |||
#include <rfb/SSecurityVeNCrypt.h> | |||
#include <rfb/CConnection.h> | |||
#include <rfb/LogWriter.h> | |||
@@ -41,8 +41,8 @@ | |||
using namespace rfb; | |||
StringParameter CSecurityTLSBase::x509ca("x509ca", "X509 CA certificate", "", ConfViewer); | |||
StringParameter CSecurityTLSBase::x509crl("x509crl", "X509 CRL file", "", ConfViewer); | |||
StringParameter CSecurityTLS::x509ca("x509ca", "X509 CA certificate", "", ConfViewer); | |||
StringParameter CSecurityTLS::x509crl("x509crl", "X509 CRL file", "", ConfViewer); | |||
static LogWriter vlog("TLS"); | |||
@@ -53,7 +53,7 @@ static void debug_log(int level, const char* str) | |||
} | |||
#endif | |||
void CSecurityTLSBase::initGlobal() | |||
void CSecurityTLS::initGlobal() | |||
{ | |||
static bool globalInitDone = false; | |||
@@ -69,14 +69,14 @@ void CSecurityTLSBase::initGlobal() | |||
} | |||
} | |||
CSecurityTLSBase::CSecurityTLSBase(bool _anon) : session(0), anon_cred(0), | |||
CSecurityTLS::CSecurityTLS(bool _anon) : session(0), anon_cred(0), | |||
anon(_anon), fis(0), fos(0) | |||
{ | |||
cafile = x509ca.getData(); | |||
crlfile = x509crl.getData(); | |||
} | |||
void CSecurityTLSBase::shutdown() | |||
void CSecurityTLS::shutdown() | |||
{ | |||
if (session) | |||
gnutls_bye(session, GNUTLS_SHUT_RDWR); | |||
@@ -100,7 +100,7 @@ void CSecurityTLSBase::shutdown() | |||
} | |||
CSecurityTLSBase::~CSecurityTLSBase() | |||
CSecurityTLS::~CSecurityTLS() | |||
{ | |||
shutdown(); | |||
@@ -113,7 +113,7 @@ CSecurityTLSBase::~CSecurityTLSBase() | |||
delete[] crlfile; | |||
} | |||
bool CSecurityTLSBase::processMsg(CConnection* cc) | |||
bool CSecurityTLS::processMsg(CConnection* cc) | |||
{ | |||
rdr::InStream* is = cc->getInStream(); | |||
rdr::OutStream* os = cc->getOutStream(); | |||
@@ -159,7 +159,7 @@ bool CSecurityTLSBase::processMsg(CConnection* cc) | |||
return true; | |||
} | |||
void CSecurityTLSBase::setParam() | |||
void CSecurityTLS::setParam() | |||
{ | |||
static const int kx_anon_priority[] = { GNUTLS_KX_ANON_DH, 0 }; | |||
static const int kx_priority[] = { GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, | |||
@@ -187,7 +187,7 @@ void CSecurityTLSBase::setParam() | |||
} | |||
} | |||
void CSecurityTLSBase::checkSession() | |||
void CSecurityTLS::checkSession() | |||
{ | |||
int status; | |||
const gnutls_datum *cert_list; |
@@ -19,8 +19,8 @@ | |||
* USA. | |||
*/ | |||
#ifndef __C_SECURITY_TLSBASE_H__ | |||
#define __C_SECURITY_TLSBASE_H__ | |||
#ifndef __C_SECURITY_TLS_H__ | |||
#define __C_SECURITY_TLS_H__ | |||
#ifdef HAVE_CONFIG_H | |||
#include <config.h> | |||
@@ -38,10 +38,10 @@ | |||
#include <gnutls/gnutls.h> | |||
namespace rfb { | |||
class CSecurityTLSBase : public CSecurity { | |||
class CSecurityTLS : public CSecurity { | |||
public: | |||
CSecurityTLSBase(bool _anon); | |||
virtual ~CSecurityTLSBase(); | |||
CSecurityTLS(bool _anon); | |||
virtual ~CSecurityTLS(); | |||
virtual bool processMsg(CConnection* cc); | |||
virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None; } | |||
virtual const char* description() const |
@@ -1,8 +1,8 @@ | |||
noinst_LTLIBRARIES = librfb.la | |||
VENCRYPT_HDRS = CSecurityTLSBase.h SSecurityTLS.h | |||
VENCRYPT_HDRS = CSecurityTLS.h SSecurityTLS.h | |||
VENCRYPT_SRCS = CSecurityTLSBase.cxx SSecurityTLS.cxx | |||
VENCRYPT_SRCS = CSecurityTLS.cxx SSecurityTLS.cxx | |||
HDRS = Blacklist.h CapsContainer.h CapsList.h CConnection.h \ | |||
CMsgHandler.h CMsgReader.h CMsgReaderV3.h CMsgWriter.h \ |
@@ -39,7 +39,7 @@ | |||
#include <rfb/SSecurityVncAuth.h> | |||
#include <rfb/SSecurityVeNCrypt.h> | |||
#ifdef HAVE_GNUTLS | |||
#include <rfb/CSecurityTLSBase.h> | |||
#include <rfb/CSecurityTLS.h> | |||
#include <rfb/SSecurityTLS.h> | |||
#endif | |||
#include <rfb/util.h> | |||
@@ -151,16 +151,16 @@ CSecurity* Security::GetCSecurity(U32 secType) | |||
#ifdef HAVE_GNUTLS | |||
case secTypeTLSNone: | |||
return new CSecurityStack(secTypeTLSNone, "TLS with no password", | |||
new CSecurityTLSBase(true)); | |||
new CSecurityTLS(true)); | |||
case secTypeTLSVnc: | |||
return new CSecurityStack(secTypeTLSVnc, "TLS with VNCAuth", | |||
new CSecurityTLSBase(true), new CSecurityVncAuth()); | |||
new CSecurityTLS(true), new CSecurityVncAuth()); | |||
case secTypeX509None: | |||
return new CSecurityStack(secTypeX509None, "X509 with no password", | |||
new CSecurityTLSBase(false)); | |||
new CSecurityTLS(false)); | |||
case secTypeX509Vnc: | |||
return new CSecurityStack(secTypeX509None, "X509 with VNCAuth", | |||
new CSecurityTLSBase(false), new CSecurityVncAuth()); | |||
new CSecurityTLS(false), new CSecurityVncAuth()); | |||
#endif | |||
} | |||