blob: 639d550e54155ac6ad5e4d4b4f1f6904936e409b [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18//
19// CSecurity - class on the client side for handling security handshaking. A
20// derived class for a particular security type overrides the processMsg()
21// method. processMsg() is called first when the security type has been
22// decided on, and will keep being called whenever there is data to read from
23// the server until either it returns false, indicating authentication/security
24// failure, or it returns with done set to true, to indicate success.
25//
26// Note that the first time processMsg() is called, there is no guarantee that
27// there is any data to read from the CConnection's InStream, but subsequent
28// calls guarantee there is at least one byte which can be read without
29// blocking.
30//
31// description is a string describing the level of encryption applied to the
32// session, or null if no encryption will be used.
33
34#ifndef __RFB_CSECURITY_H__
35#define __RFB_CSECURITY_H__
36
37namespace rfb {
38 class CConnection;
39 class CSecurity {
40 public:
41 virtual ~CSecurity() {}
42 virtual bool processMsg(CConnection* cc, bool* done)=0;
43 virtual void destroy() { delete this; }
44 virtual int getType() const = 0;
45 virtual const char* description() const = 0;
46 };
47}
48#endif