Bug 767505 - ProcessAuthentication misses error check for non-SSL CONNECT. r=mcmanus

This commit is contained in:
Jason Duell 2012-06-25 12:48:49 -07:00
parent 64489ed632
commit 308098b8e2
3 changed files with 8 additions and 9 deletions

View File

@ -1270,8 +1270,7 @@ nsHttpChannel::ProcessResponse()
case 401:
case 407:
rv = mAuthProvider->ProcessAuthentication(
httpStatus, mConnectionInfo->UsingSSL() &&
mTransaction->SSLConnectFailed());
httpStatus, mTransaction->SSLConnectFailed());
if (rv == NS_ERROR_IN_PROGRESS) {
// authentication prompt has been invoked and result
// is expected asynchronously

View File

@ -68,11 +68,11 @@ nsHttpChannelAuthProvider::Init(nsIHttpAuthenticableChannel *channel)
NS_IMETHODIMP
nsHttpChannelAuthProvider::ProcessAuthentication(PRUint32 httpStatus,
bool SSLConnectFailed)
bool ProxyConnectFailed)
{
LOG(("nsHttpChannelAuthProvider::ProcessAuthentication "
"[this=%p channel=%p code=%u SSLConnectFailed=%d]\n",
this, mAuthChannel, httpStatus, SSLConnectFailed));
"[this=%p channel=%p code=%u ProxyConnectFailed=%d]\n",
this, mAuthChannel, httpStatus, ProxyConnectFailed));
NS_ASSERTION(mAuthChannel, "Channel not initialized");
@ -113,7 +113,7 @@ nsHttpChannelAuthProvider::ProcessAuthentication(PRUint32 httpStatus,
LOG(("rejecting 407 when proxy server not configured!\n"));
return NS_ERROR_UNEXPECTED;
}
if (UsingSSL() && !SSLConnectFailed) {
if (!ProxyConnectFailed) {
// we need to verify that this challenge came from the proxy
// server itself, and not some server on the other side of the
// SSL tunnel.

View File

@ -40,8 +40,8 @@ interface nsIHttpChannelAuthProvider : nsICancelable
*
* @param httpStatus
* the http status received.
* @param sslConnectFailed
* if the last ssl tunnel connection attempt was or not successful.
* @param proxyConnectFailed
* if attempt to create CONNECT tunnel via proxy failed.
* @param callback
* the callback to be called when it returns NS_ERROR_IN_PROGRESS.
* The implementation must hold a weak reference.
@ -54,7 +54,7 @@ interface nsIHttpChannelAuthProvider : nsICancelable
* until disconnect be called.
*/
void processAuthentication(in unsigned long httpStatus,
in boolean sslConnectFailed);
in boolean proxyConnectFailed);
/**
* Add credentials from the http auth cache.