reSIProcate/DialogUsageManager  9694
Public Member Functions | Private Attributes
ClientAuthDecorator Class Reference
Inheritance diagram for ClientAuthDecorator:
Inheritance graph
[legend]
Collaboration diagram for ClientAuthDecorator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ClientAuthDecorator (bool isProxyCredential, const Auth &auth, const UserProfile::DigestCredential &credential, const Data &authQop, const Data &nonceCountString)
virtual ~ClientAuthDecorator ()
virtual void decorateMessage (SipMessage &msg, const Tuple &source, const Tuple &destination, const Data &sigcompId)
virtual void rollbackMessage (SipMessage &msg)
virtual MessageDecoratorclone () const

Private Attributes

bool mIsProxyCredential
Auth mAuth
UserProfile::DigestCredential mCredential
Data mAuthQop
Data mNonceCountString

Detailed Description

Definition at line 16 of file ClientAuthManager.cxx.


Constructor & Destructor Documentation

ClientAuthDecorator::ClientAuthDecorator ( bool  isProxyCredential,
const Auth auth,
const UserProfile::DigestCredential credential,
const Data authQop,
const Data nonceCountString 
) [inline]

Definition at line 19 of file ClientAuthManager.cxx.

                                                                                                                                                                   :
      mIsProxyCredential(isProxyCredential), mAuth(auth), mCredential(credential), mAuthQop(authQop), mNonceCountString(nonceCountString) {}
virtual ClientAuthDecorator::~ClientAuthDecorator ( ) [inline, virtual]

Definition at line 21 of file ClientAuthManager.cxx.

{}

Member Function Documentation

virtual MessageDecorator* ClientAuthDecorator::clone ( ) const [inline, virtual]
virtual void ClientAuthDecorator::decorateMessage ( SipMessage msg,
const Tuple source,
const Tuple destination,
const Data sigcompId 
) [inline, virtual]

Implements resip::MessageDecorator.

Definition at line 22 of file ClientAuthManager.cxx.

References resip::ParserContainer< T >::back(), DebugLog, resip::Random::getCryptoRandomHex(), resip::SipMessage::header(), resip::ClientAuthExtension::instance(), resip::Helper::makeChallengeResponseAuth(), resip::ClientAuthExtension::makeChallengeResponseAuth(), resip::Helper::makeChallengeResponseAuthWithA1(), resip::ClientAuthExtension::makeChallengeResponseAuthWithA1(), and resip::ParserContainer< T >::push_back().

   {
      Data cnonce = Random::getCryptoRandomHex(16);

      Auths & target = mIsProxyCredential ? msg.header(h_ProxyAuthorizations) : msg.header(h_Authorizations);
   
      DebugLog( << " Add auth, " << this << " in response to: " << mAuth);
      Auth auth;
      if (ClientAuthExtension::instance().algorithmAndQopSupported(mAuth))
      {
         DebugLog(<<"Using extension to make auth response");
      
         if(mCredential.isPasswordA1Hash)
         {
            ClientAuthExtension::instance().makeChallengeResponseAuthWithA1(msg,
                                                            mCredential.user,
                                                            mCredential.password,
                                                            mAuth, 
                                                            cnonce,
                                                            mAuthQop, 
                                                            mNonceCountString,
                                                            auth);      
         }
         else
         {
            ClientAuthExtension::instance().makeChallengeResponseAuth(msg,
                                                            mCredential.user,
                                                            mCredential.password,
                                                            mAuth, 
                                                            cnonce,
                                                            mAuthQop, 
                                                            mNonceCountString,
                                                            auth);      
         }
      }
      else
      {
         if(mCredential.isPasswordA1Hash)
         {
            Helper::makeChallengeResponseAuthWithA1(msg, 
                                           mCredential.user, 
                                           mCredential.password, 
                                           mAuth, 
                                           cnonce, 
                                           mAuthQop, 
                                           mNonceCountString, 
                                           auth);
         }
         else
         {
            Helper::makeChallengeResponseAuth(msg, 
                                           mCredential.user, 
                                           mCredential.password, 
                                           mAuth, 
                                           cnonce, 
                                           mAuthQop, 
                                           mNonceCountString, 
                                           auth);
         }
      }
      target.push_back(auth);
   
      DebugLog(<<"ClientAuthDecorator, proxy: " << mIsProxyCredential << " " << target.back());
   }

Here is the call graph for this function:

virtual void ClientAuthDecorator::rollbackMessage ( SipMessage msg) [inline, virtual]

Implements resip::MessageDecorator.

Definition at line 89 of file ClientAuthManager.cxx.

References resip::SipMessage::header(), and resip::ParserContainerBase::pop_back().

   {
      Auths & target = mIsProxyCredential ? msg.header(h_ProxyAuthorizations) : msg.header(h_Authorizations);
      target.pop_back();
   }  

Here is the call graph for this function:


Member Data Documentation

Definition at line 97 of file ClientAuthManager.cxx.

Definition at line 99 of file ClientAuthManager.cxx.

Definition at line 98 of file ClientAuthManager.cxx.

Definition at line 96 of file ClientAuthManager.cxx.

Definition at line 100 of file ClientAuthManager.cxx.


The documentation for this class was generated from the following file: