blob: 3ad6eb2ca3533b88e0a526759278102c62947a69 [file] [log] [blame]
Adam Tkacb10489b2010-04-23 14:16:04 +00001/*
2 * Copyright (C) 2005-2006 Martin Koegler
3 * Copyright (C) 2006 OCCAM Financial Technology
4 * Copyright (C) 2010 TigerVNC Team
5 *
6 * This is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this software; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
20 */
21//
22// CSecurityVeNCrypt
23//
24
25#ifndef __CSECURITYVENCRYPT_H__
26#define __CSECURITYVENCRYPT_H__
27
28#include <rfb/CSecurity.h>
29#include <rfb/CSecurityStack.h>
30#include <rfb/Security.h>
31#include <rdr/types.h>
32
33namespace rfb {
34
35 class CSecurityVeNCrypt : public CSecurity {
36 public:
37
Adam Tkaca0325932010-07-20 15:14:08 +000038 CSecurityVeNCrypt(Security* sec);
Adam Tkacb10489b2010-04-23 14:16:04 +000039 ~CSecurityVeNCrypt();
40 virtual bool processMsg(CConnection* cc);// { return true; }
41 int getType() const {return chosenType;}
42 virtual const char* description() const { return secTypeName(chosenType); }
43
44 static StringParameter secTypesStr;
45 protected:
46 static CSecurityStack* getCSecurityStack(int secType);
47
Adam Tkacc86db212010-07-20 15:08:58 +000048 CSecurity *csecurity;
Adam Tkaca0325932010-07-20 15:14:08 +000049 Security *security;
Adam Tkacb10489b2010-04-23 14:16:04 +000050 bool haveRecvdMajorVersion;
51 bool haveRecvdMinorVersion;
52 bool haveSentVersion;
53 bool haveAgreedVersion;
54 bool haveListOfTypes;
55 bool haveNumberOfTypes;
56 bool haveChosenType;
57 rdr::U8 majorVersion, minorVersion;
58 rdr::U32 chosenType;
59 rdr::U8 nAvailableTypes;
60 rdr::U32 *availableTypes;
61 rdr::U8 iAvailableType;
62 const char* desc;
63 };
64}
65#endif