reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ReproTlsPeerAuthManager.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2 #include "config.h"
3#endif
4
5#include "rutil/Logger.hxx"
7
8#define RESIPROCATE_SUBSYSTEM Subsystem::REPRO
9
10using namespace resip;
11using namespace repro;
12
13ReproTlsPeerAuthManager::ReproTlsPeerAuthManager(DialogUsageManager& dum, TargetCommand::Target& target, Dispatcher* authRequestDispatcher, AclStore& aclStore, bool thirdPartyRequiresCertificate, CommonNameMappings& commonNameMappings) :
14 TlsPeerAuthManager(dum, target, std::set<resip::Data>(), thirdPartyRequiresCertificate, commonNameMappings),
15 mAuthRequestDispatcher(authRequestDispatcher),
16 mAclStore(aclStore)
17{
18}
19
23
26{
27 std::unique_ptr<ApplicationMessage> app(info);
29 return Async;
30}
31
32bool
34{
35 const std::list<resip::Data> &peerNames = msg.getTlsPeerNames();
36 if(mAclStore.isTlsPeerNameTrusted(peerNames))
37 {
38 DebugLog(<< "Matched trusted peer by certificate in ACL, not checking against From URI");
39 return true;
40 }
41
43}
44
45/* ====================================================================
46 * BSD License
47 *
48 * Copyright (c) 2014 Daniel Pocock All rights reserved.
49 *
50 * Redistribution and use in source and binary forms, with or without
51 * modification, are permitted provided that the following conditions
52 * are met:
53 *
54 * 1. Redistributions of source code must retain the above copyright
55 * notice, this list of conditions and the following disclaimer.
56 *
57 * 2. Redistributions in binary form must reproduce the above copyright
58 * notice, this list of conditions and the following disclaimer in
59 * the documentation and/or other materials provided with the
60 * distribution.
61 *
62 * 3. Neither the name of the author(s) nor the names of any contributors
63 * may be used to endorse or promote products derived from this software
64 * without specific prior written permission.
65 *
66 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
67 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
69 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
70 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
71 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
72 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
73 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
74 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
75 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
76 * SUCH DAMAGE.
77 *
78 * ====================================================================
79 *
80 */
81
#define DebugLog(args_)
Definition Logger.hxx:128
bool isTlsPeerNameTrusted(const std::list< resip::Data > &tlsPeerNames)
Definition AclStore.cxx:497
ReproTlsPeerAuthManager(resip::DialogUsageManager &dum, resip::TargetCommand::Target &target, resip::Dispatcher *authRequestDispatcher, AclStore &aclStore, bool thirdPartyRequiresCertificate, resip::CommonNameMappings &commonNameMappings)
virtual bool isTrustedSource(const resip::SipMessage &msg)
should return true if the request should be trusted based on the source/transport default implementat...
virtual resip::AsyncBool asyncLookup(resip::TlsPeerIdentityInfoMessage *info)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
A generic thread-bank class.
virtual bool post(std::unique_ptr< resip::ApplicationMessage > &work)
Posts a message to this thread bank.
Represents a SIP message.
const std::list< Data > & getTlsPeerNames() const
virtual bool isTrustedSource(const SipMessage &msg)
should return true if the request should be trusted based on the source/transport default implementat...
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;
std::map< Data, PermittedFromAddresses > CommonNameMappings