virtual ~CSecurity() {}
virtual bool processMsg() = 0;
virtual int getType() const = 0;
- virtual const char* description() const = 0;
virtual bool isSecure() const { return false; }
/*
CSecurityNone(CConnection* cc) : CSecurity(cc) {}
virtual bool processMsg() { return true; }
virtual int getType() const {return secTypeNone;}
- virtual const char* description() const {return "No Encryption";}
};
}
#endif
CSecurityPlain(CConnection* cc) : CSecurity(cc) {}
virtual bool processMsg();
virtual int getType() const { return secTypePlain; }
- virtual const char* description() const { return "ask for username and password"; }
};
}
#endif
using namespace rfb;
-CSecurityStack::CSecurityStack(CConnection* cc, int Type, const char* Name,
+CSecurityStack::CSecurityStack(CConnection* cc, int Type,
CSecurity* s0, CSecurity* s1)
- : CSecurity(cc), name(Name), type(Type)
+ : CSecurity(cc), type(Type)
{
state = 0;
state0 = s0;
class CSecurityStack : public CSecurity {
public:
- CSecurityStack(CConnection* cc, int Type, const char *Name,
+ CSecurityStack(CConnection* cc, int Type,
CSecurity* s0 = NULL, CSecurity* s1 = NULL);
~CSecurityStack();
virtual bool processMsg();
virtual int getType() const {return type;};
- virtual const char* description() const {return name;}
virtual bool isSecure() const;
protected:
int state;
CSecurity* state0;
CSecurity* state1;
- const char* name;
int type;
};
}
virtual ~CSecurityTLS();
virtual bool processMsg();
virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None; }
- virtual const char* description() const
- { return anon ? "TLS Encryption without VncAuth" : "X509 Encryption without VncAuth"; }
virtual bool isSecure() const { return !anon; }
static StringParameter X509CA;
return csecurity->processMsg();
}
-const char* CSecurityVeNCrypt::description() const
-{
- if (csecurity)
- return csecurity->description();
- return "VeNCrypt";
-}
-
bool CSecurityVeNCrypt::isSecure() const
{
if (csecurity && csecurity->isSecure())
~CSecurityVeNCrypt();
virtual bool processMsg();
int getType() const {return chosenType;}
- virtual const char* description() const;
virtual bool isSecure() const;
protected:
virtual ~CSecurityVncAuth() {}
virtual bool processMsg();
virtual int getType() const {return secTypeVncAuth;};
- virtual const char* description() const {return "No Encryption";}
};
}
#endif
#ifdef HAVE_GNUTLS
case secTypeTLSNone:
return new CSecurityStack(cc, secTypeTLSNone,
- "TLS with no password",
new CSecurityTLS(cc, true));
case secTypeTLSVnc:
return new CSecurityStack(cc, secTypeTLSVnc,
- "TLS with VNCAuth",
new CSecurityTLS(cc, true),
new CSecurityVncAuth(cc));
case secTypeTLSPlain:
return new CSecurityStack(cc, secTypeTLSPlain,
- "TLS with Username/Password",
new CSecurityTLS(cc, true),
new CSecurityPlain(cc));
case secTypeX509None:
return new CSecurityStack(cc, secTypeX509None,
- "X509 with no password",
new CSecurityTLS(cc, false));
case secTypeX509Vnc:
return new CSecurityStack(cc, secTypeX509Vnc,
- "X509 with VNCAuth",
new CSecurityTLS(cc, false),
new CSecurityVncAuth(cc));
case secTypeX509Plain:
return new CSecurityStack(cc, secTypeX509Plain,
- "X509 with Username/Password",
new CSecurityTLS(cc, false),
new CSecurityPlain(cc));
#endif