[asterisk-scf-commits] asterisk-scf/release/sip.git branch "authexten" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Feb 22 17:28:13 CST 2011
branch "authexten" has been updated
via 65074861612bdb49965f66e09c55ccbec46f960d (commit)
from d23a05405132459594db5c41bd4485207a887cce (commit)
Summary of changes:
src/AuthManager.cpp | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 65074861612bdb49965f66e09c55ccbec46f960d
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Feb 22 17:27:47 2011 -0600
Update to reflect the visitor additions to the SIPExtensionPointIf.ice file.
diff --git a/src/AuthManager.cpp b/src/AuthManager.cpp
index a17ecbd..b2fc8f4 100644
--- a/src/AuthManager.cpp
+++ b/src/AuthManager.cpp
@@ -205,11 +205,32 @@ void AuthInstance::addDigests(pjsip_tx_data *tdata, const DigestChallengeSeq &di
pj_cstr(&opaque, (*digest)->opaque.front().c_str());
opaquePtr = &opaque;
}
- if (!(*digest)->nonce.empty())
+
+ class visitor : public DigestChallengeVisitor
{
- pj_cstr(&nonce, (*digest)->nonce.front().c_str());
- noncePtr = &nonce;
- }
+ public:
+ visitor(pj_str_t *nonce, pj_str_t **noncePtr) : mNonce(nonce), mNoncePtr(noncePtr) { }
+ private:
+ void visitMD5(MD5DigestChallengePtr md5, Ice::Current &)
+ {
+ }
+ void visitAKAv1(AKAv1DigestChallengePtr aka, Ice::Current &)
+ {
+ pj_cstr(mNonce, aka->nonce.c_str());
+ *mNoncePtr = mNonce;
+ }
+ void visitAKAv2(AKAv2DigestChallengePtr aka, Ice::Current &)
+ {
+ pj_cstr(mNonce, aka->nonce.c_str());
+ *mNoncePtr = mNonce;
+ }
+
+ pj_str_t *mNonce;
+ pj_str_t **mNoncePtr;
+ } v(&nonce, &noncePtr);
+
+ (*digest)->visit(&v);
+
pjsip_auth_srv_challenge(authServer, &pjqop, noncePtr, opaquePtr, PJ_FALSE, tdata);
mImpl->authServers.push_back(authServer);
}
-----------------------------------------------------------------------
--
asterisk-scf/release/sip.git
More information about the asterisk-scf-commits
mailing list