1#if defined(HAVE_CONFIG_H)
23#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
29#ifdef USE_RADIUS_CLIENT
31RADIUSAuthenticator::RADIUSAuthenticator(
ProxyConfig& config,
33 const Data& staticRealm,
34 const std::vector<resip::DigestType>& challengeDigestTypes) :
37 RADIUSDigestAuthenticator::init(
38 configurationFile.
empty() ? 0 : configurationFile.
c_str());
41RADIUSAuthenticator::~RADIUSAuthenticator()
50 ReproRADIUSDigestAuthListener *radiusListener = 0;
57 radiusListener =
new ReproRADIUSDigestAuthListener(userInfo, rc.
getProxy());
60 Data radiusUser = user;
61 DebugLog(<<
"radiusUser = " << radiusUser.
c_str() <<
", " <<
"user = " << user.
c_str());
65 RADIUSDigestAuthenticator *radius = NULL;
71 radius =
new RADIUSDigestAuthenticator(
72 radiusUser, user, realm, auth.
param(p_nonce),
73 reqUri, reqMethod, myQop, auth.
param(p_nc), auth.
param(p_cnonce),
74 auth.
param(p_response),
79 Data myQop(
"auth-int");
80 radius =
new RADIUSDigestAuthenticator(
81 radiusUser, user, realm, auth.
param(p_nonce),
82 reqUri, reqMethod, myQop, auth.
param(p_nc), auth.
param(p_cnonce),
84 auth.
param(p_response),
90 radius =
new RADIUSDigestAuthenticator(
91 radiusUser, user, realm, auth.
param(p_nonce),
93 auth.
param(p_response),
96 int result = radius->doRADIUSCheck();
99 ErrLog(<<
"RADIUSServerAuthManager::requestCredential, uri = " << reqUri <<
" failed to start thread, error = " << result);
102 return SkipAllChains;
107 WarningLog(<<
"RADIUSServerAuthManager::requestCredential, unexpected exception thrown");
108 delete radiusListener;
111 return SkipAllChains;
113 return WaitingForEvent;
116ReproRADIUSDigestAuthListener::ReproRADIUSDigestAuthListener(
123ReproRADIUSDigestAuthListener::~ReproRADIUSDigestAuthListener()
128ReproRADIUSDigestAuthListener::onSuccess(
const resip::Data& rpid)
130 DebugLog(<<
"ReproRADIUSDigestAuthListener::onSuccess");
133 DebugLog(<<
"ReproRADIUSDigestAuthListener::onSuccess rpid = " << rpid.
c_str());
137 DebugLog(<<
"ReproRADIUSDigestAuthListener::onSuccess, no rpid");
144ReproRADIUSDigestAuthListener::onAccessDenied()
146 DebugLog(<<
"ReproRADIUSDigestAuthListener::onAccessDenied");
152ReproRADIUSDigestAuthListener::onError()
154 WarningLog(<<
"ReproRADIUSDigestAuthListener::onError");
#define WarningLog(args_)
#define resip_assert(x)
This file needs to work for both C and C++ code.
resip::Message * getCurrentEvent()
Returns the event that we are currently working on.
void sendResponse(resip::SipMessage &response)
const resip::Data & user() const
const resip::Data & realm() const
Represents the "credentials" and "challenge" elements in the SIP grammar.
bool exists(const Param< Auth > ¶mType) const
const Data & param(const ExtensionParameter ¶m) const
Const accessor for non-natively-supported parameter types.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
const char * c_str() const
Returns a null-terminated string representing.
bool empty() const noexcept
Checks whether the Data is empty.
static void makeResponse(SipMessage &response, const SipMessage &request, int responseCode, const Data &reason=Data::Empty, const Data &hostname=Data::Empty, const Data &warning=Data::Empty)
Make a response to a provided request.
The base-class used for message-passing.
MethodTypes getMethod() const
Represents a SIP message.
bool isRequest() const
Returns true if message is a request, false otherwise.
const RequestLine & header(const RequestLineType &l) const
Returns the RequestLine. This is only valid for request messages.
static const char * authInt
The base-class for an RFC 3261 Transaction User.
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;
const Data & getMethodName(MethodTypes t)
RequestLineType h_RequestLine