blob: d015e8f2cdb952735078dd761257db920140b4d6 [file] [log] [blame]
Adam Tkac5522d612010-08-11 15:28:01 +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>
Adam Tkacbfd66c12010-10-01 08:33:29 +000029#include <rfb/SecurityClient.h>
Adam Tkac5522d612010-08-11 15:28:01 +000030#include <rdr/types.h>
31
32namespace rfb {
33
34 class CSecurityVeNCrypt : public CSecurity {
35 public:
36
Pierre Ossmanad2b3c42018-09-21 15:31:11 +020037 CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec);
Adam Tkac5522d612010-08-11 15:28:01 +000038 ~CSecurityVeNCrypt();
Pierre Ossmanad2b3c42018-09-21 15:31:11 +020039 virtual bool processMsg();
Adam Tkac5522d612010-08-11 15:28:01 +000040 int getType() const {return chosenType;}
Pierre Ossmanb993ea72017-09-01 11:15:57 +020041 virtual const char* description() const;
Pierre Ossmandaf3d882017-09-01 11:14:35 +020042 virtual bool isSecure() const;
Adam Tkac5522d612010-08-11 15:28:01 +000043
Adam Tkac5522d612010-08-11 15:28:01 +000044 protected:
45 CSecurity *csecurity;
Adam Tkacbfd66c12010-10-01 08:33:29 +000046 SecurityClient *security;
Adam Tkac5522d612010-08-11 15:28:01 +000047 bool haveRecvdMajorVersion;
48 bool haveRecvdMinorVersion;
49 bool haveSentVersion;
50 bool haveAgreedVersion;
51 bool haveListOfTypes;
52 bool haveNumberOfTypes;
53 bool haveChosenType;
54 rdr::U8 majorVersion, minorVersion;
55 rdr::U32 chosenType;
56 rdr::U8 nAvailableTypes;
57 rdr::U32 *availableTypes;
58 rdr::U8 iAvailableType;
Adam Tkac5522d612010-08-11 15:28:01 +000059 };
60}
61#endif