/[resiprocate]/main/resip/dum/TlsPeerAuthManager.hxx
ViewVC logotype

Contents of /main/resip/dum/TlsPeerAuthManager.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10859 - (show annotations) (download)
Mon Jan 13 22:07:19 2014 UTC (5 years, 9 months ago) by Dpocock
File size: 3638 byte(s)
resip: dum: TlsPeerManager: tweak member order to eliminate compiler warning
1 #if !defined(RESIP_TLSPEERAUTHMANAGER_HXX)
2 #define RESIP_TLSPEERAUTHMANAGER_HXX
3
4 #include <map>
5 #include <set>
6
7 #include "resip/stack/SipMessage.hxx"
8 #include "DumFeature.hxx"
9
10 namespace resip
11 {
12 class DialogUsageManager;
13
14 typedef std::set<Data> PermittedFromAddresses;
15 typedef std::map<Data, PermittedFromAddresses> CommonNameMappings;
16
17 class TlsPeerAuthManager : public DumFeature
18 {
19 public:
20 enum Result
21 {
22 Authorized,
23 Skipped,
24 Rejected
25 };
26
27 TlsPeerAuthManager(DialogUsageManager& dum, TargetCommand::Target& target, const std::set<Data>& trustedPeers, bool thirdPartyRequiresCertificate = true);
28 TlsPeerAuthManager(DialogUsageManager& dum, TargetCommand::Target& target, const std::set<Data>& trustedPeers, bool thirdPartyRequiresCertificate, CommonNameMappings& commonNameMappings);
29 virtual ~TlsPeerAuthManager();
30
31 virtual ProcessingResult process(Message* msg);
32
33 protected:
34
35 // can return Authorized, Rejected, Skipped
36 virtual Result handle(SipMessage* sipMsg);
37
38 /// should return true if the passed in user is authorized for the provided uri
39 virtual bool authorizedForThisIdentity(const std::list<resip::Data> &peerNames,
40 resip::Uri &fromUri);
41
42 /// should return true if the request must be challenged
43 /// The default is to challenge all requests - override this class to change this beviour
44 virtual bool requiresAuthorization(const SipMessage& msg);
45 /// should return true if the request should be trusted based on
46 /// the source/transport
47 /// default implementation uses mTrustedPeers
48 virtual bool isTrustedSource(const SipMessage& msg);
49
50 private:
51 std::set<Data> mTrustedPeers;
52 bool mThirdPartyRequiresCertificate;
53 CommonNameMappings mCommonNameMappings;
54 };
55
56
57 }
58
59 #endif
60
61 /* ====================================================================
62 * BSD License
63 *
64 * Copyright (c) 2012 Daniel Pocock All rights reserved.
65 *
66 * Redistribution and use in source and binary forms, with or without
67 * modification, are permitted provided that the following conditions
68 * are met:
69 *
70 * 1. Redistributions of source code must retain the above copyright
71 * notice, this list of conditions and the following disclaimer.
72 *
73 * 2. Redistributions in binary form must reproduce the above copyright
74 * notice, this list of conditions and the following disclaimer in
75 * the documentation and/or other materials provided with the
76 * distribution.
77 *
78 * 3. Neither the name of the author(s) nor the names of any contributors
79 * may be used to endorse or promote products derived from this software
80 * without specific prior written permission.
81 *
82 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
83 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
84 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
85 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
86 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
87 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
88 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
89 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
90 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
91 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
92 * SUCH DAMAGE.
93 *
94 * ====================================================================
95 *
96 */

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27