blob: 165881ece3d210beb76664cbe1005ac261fc0117 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 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//
20// SSecurityFactoryStandard - implementation of the SSecurityFactory
21// interface.
22//
23// Server implementations must define an instance of a
24// VncAuthPasswdParameter-based class somewhere. Any class based on
25// VncAuthPasswdParameter will automatically register itself as the
26// password parameter to be used by the Standard factory.
27//
28// Two implementations are provided here:
29//
30// VncAuthPasswdConfigParameter - reads the password from the Binary
31// parameter "Password".
32// VncAuthPasswdFileParameter - reads the password from the file named
33// in the String parameter "PasswordFile".
34//
35// This factory supports only the "None" and "VncAuth" security types.
36//
37
38#ifndef __RFB_SSECURITYFACTORY_STANDARD_H__
39#define __RFB_SSECURITYFACTORY_STANDARD_H__
40
41#include <rfb/SSecurityVncAuth.h>
42#include <rfb/Configuration.h>
43#include <rfb/util.h>
44
45namespace rfb {
46
47 class VncAuthPasswdParameter : public VncAuthPasswdGetter, BinaryParameter {
48 public:
49 VncAuthPasswdParameter(const char* name, const char* desc, StringParameter* passwdFile_);
50 virtual char* getVncAuthPasswd();
51 protected:
52 StringParameter* passwdFile;
53 };
54
55 class SSecurityFactoryStandard : public SSecurityFactory {
56 public:
57 virtual SSecurity* getSSecurity(rdr::U8 secType, bool reverse);
58 virtual void getSecTypes(std::list<rdr::U8>* secTypes, bool reverse);
59 static StringParameter sec_types;
60 static StringParameter rev_sec_types;
61 static StringParameter vncAuthPasswdFile;
62 static VncAuthPasswdParameter vncAuthPasswd;
63 protected:
64 virtual bool isSecTypeSupported(rdr::U8 secType);
65 };
66
67}
68#endif