diff options
author | Chung-yih Wang <cywang@google.com> | 2010-09-14 14:01:13 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2010-09-14 14:17:02 +0800 |
commit | 7d137e40cd36290c6bfb5beaf66f4018ae92c97f (patch) | |
tree | 91f5e415016d5e7c1162d464a8765ed5e7f09ca5 /services/java | |
parent | 4565933f03a99750a333e97e95408c404984510f (diff) | |
download | frameworks_base-7d137e40cd36290c6bfb5beaf66f4018ae92c97f.zip frameworks_base-7d137e40cd36290c6bfb5beaf66f4018ae92c97f.tar.gz frameworks_base-7d137e40cd36290c6bfb5beaf66f4018ae92c97f.tar.bz2 |
Fix the bug of authentication in an outgoing call.
Since we missed the check of another challenge header in the
proxy authentication response.
Change-Id: Ie5b9d22c6c55b4d65619d2194c88845e7dd59f15
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/sip/SipSessionGroup.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/java/com/android/server/sip/SipSessionGroup.java b/services/java/com/android/server/sip/SipSessionGroup.java index 94769d8..e720274 100644 --- a/services/java/com/android/server/sip/SipSessionGroup.java +++ b/services/java/com/android/server/sip/SipSessionGroup.java @@ -19,6 +19,7 @@ package com.android.server.sip; import gov.nist.javax.sip.clientauthutils.AccountManager; import gov.nist.javax.sip.clientauthutils.UserCredentials; import gov.nist.javax.sip.header.SIPHeaderNames; +import gov.nist.javax.sip.header.ProxyAuthenticate; import gov.nist.javax.sip.header.WWWAuthenticate; import gov.nist.javax.sip.message.SIPMessage; @@ -731,7 +732,8 @@ class SipSessionGroup implements SipListener { Response response = event.getResponse(); String nonce = getNonceFromResponse(response); if (((nonce != null) && nonce.equals(mLastNonce)) || - (nonce == mLastNonce)) { + (nonce == null)) { + mLastNonce = nonce; return false; } else { mClientTransaction = mSipHelper.handleChallenge( @@ -764,9 +766,12 @@ class SipSessionGroup implements SipListener { } private String getNonceFromResponse(Response response) { - WWWAuthenticate authHeader = (WWWAuthenticate)(response.getHeader( - SIPHeaderNames.WWW_AUTHENTICATE)); - return (authHeader == null) ? null : authHeader.getNonce(); + WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader( + SIPHeaderNames.WWW_AUTHENTICATE); + if (wwwAuth != null) return wwwAuth.getNonce(); + ProxyAuthenticate proxyAuth = (ProxyAuthenticate)response.getHeader( + SIPHeaderNames.PROXY_AUTHENTICATE); + return (proxyAuth == null) ? null : proxyAuth.getNonce(); } private boolean readyForCall(EventObject evt) throws SipException { |