reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TlsPeerAuthManager.hxx
Go to the documentation of this file.
1#if !defined(RESIP_TLSPEERAUTHMANAGER_HXX)
2#define RESIP_TLSPEERAUTHMANAGER_HXX
3
4#include <map>
5#include <set>
6
7#include "rutil/AsyncBool.hxx"
9#include "DumFeature.hxx"
11
12namespace resip
13{
14class DialogUsageManager;
15
16typedef std::set<Data> PermittedFromAddresses;
17typedef std::map<Data, PermittedFromAddresses> CommonNameMappings;
18
20{
21 public:
29
30 TlsPeerAuthManager(DialogUsageManager& dum, TargetCommand::Target& target, const std::set<Data>& trustedPeers, bool thirdPartyRequiresCertificate = true);
31 TlsPeerAuthManager(DialogUsageManager& dum, TargetCommand::Target& target, const std::set<Data>& trustedPeers, bool thirdPartyRequiresCertificate, CommonNameMappings& commonNameMappings);
32 virtual ~TlsPeerAuthManager();
33
34 virtual ProcessingResult process(Message* msg);
35
36 protected:
37
38 // can return Authorized, Rejected, Skipped
39 virtual Result handle(SipMessage* sipMsg);
41
43 virtual AsyncBool authorizedForThisIdentity(const resip::Data& transactionId, const std::list<resip::Data> &peerNames,
44 resip::Uri &fromUri);
45
48 virtual bool requiresAuthorization(const SipMessage& msg);
53 virtual bool isTrustedSource(const SipMessage& msg);
54
55 private:
56 typedef std::map<Data, SipMessage*> MessageMap;
57 MessageMap mMessages;
58
59 std::set<Data> mTrustedPeers;
60 bool mThirdPartyRequiresCertificate;
61 CommonNameMappings mCommonNameMappings;
62};
63
64
65}
66
67#endif
68
69/* ====================================================================
70 * BSD License
71 *
72 * Copyright (c) 2012 Daniel Pocock All rights reserved.
73 *
74 * Redistribution and use in source and binary forms, with or without
75 * modification, are permitted provided that the following conditions
76 * are met:
77 *
78 * 1. Redistributions of source code must retain the above copyright
79 * notice, this list of conditions and the following disclaimer.
80 *
81 * 2. Redistributions in binary form must reproduce the above copyright
82 * notice, this list of conditions and the following disclaimer in
83 * the documentation and/or other materials provided with the
84 * distribution.
85 *
86 * 3. Neither the name of the author(s) nor the names of any contributors
87 * may be used to endorse or promote products derived from this software
88 * without specific prior written permission.
89 *
90 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
91 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
92 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
93 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
94 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
95 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
96 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
97 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
98 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
99 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
100 * SUCH DAMAGE.
101 *
102 * ====================================================================
103 *
104 */
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
The base-class used for message-passing.
Definition Message.hxx:21
Represents a SIP message.
virtual bool isTrustedSource(const SipMessage &msg)
should return true if the request should be trusted based on the source/transport default implementat...
virtual ProcessingResult process(Message *msg)
virtual AsyncBool asyncLookup(TlsPeerIdentityInfoMessage *info)
virtual SipMessage * handleTlsPeerIdentityInfo(TlsPeerIdentityInfoMessage *tpiInfo)
virtual bool requiresAuthorization(const SipMessage &msg)
should return true if the request must be challenged The default is to challenge all requests - overr...
virtual AsyncBool authorizedForThisIdentity(const resip::Data &transactionId, const std::list< resip::Data > &peerNames, resip::Uri &fromUri)
should return true if the passed in user is authorized for the provided uri
virtual Result handle(SipMessage *sipMsg)
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
std::map< Data, PermittedFromAddresses > CommonNameMappings
std::set< Data > PermittedFromAddresses