Title: [99800] trunk/Source
Revision
99800
Author
[email protected]
Date
2011-11-09 18:48:40 -0800 (Wed, 09 Nov 2011)

Log Message

<rdar://problem/10423024> WebProcess doesn't use AuthBrokerAgent for proxy credentials
https://bugs.webkit.org/show_bug.cgi?id=71964

Reviewed by Darin Adler.

Source/WebCore:

* platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
* platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
Don't ask the client for proxy credentials. CFNetwork results are authoritative, and proxy
credentials are system-wide.

Source/WebKit2:

* WebProcess/com.apple.WebProcess.sb: Allow mach-lookup of com.apple.cfnetwork.AuthBrokerAgent.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99799 => 99800)


--- trunk/Source/WebCore/ChangeLog	2011-11-10 02:40:13 UTC (rev 99799)
+++ trunk/Source/WebCore/ChangeLog	2011-11-10 02:48:40 UTC (rev 99800)
@@ -1,3 +1,15 @@
+2011-11-09  Alexey Proskuryakov  <[email protected]>
+
+        <rdar://problem/10423024> WebProcess doesn't use AuthBrokerAgent for proxy credentials
+        https://bugs.webkit.org/show_bug.cgi?id=71964
+
+        Reviewed by Darin Adler.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+        * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+        Don't ask the client for proxy credentials. CFNetwork results are authoritative, and proxy
+        credentials are system-wide.
+
 2011-11-09  Daniel Sievers  <[email protected]>
 
         [chromium] Fix typo in checkerboarding code

Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (99799 => 99800)


--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2011-11-10 02:40:13 UTC (rev 99799)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2011-11-10 02:48:40 UTC (rev 99800)
@@ -577,6 +577,16 @@
     ASSERT(challenge.cfURLAuthChallengeRef());
     ASSERT(challenge.authenticationClient() == this); // Should be already set.
 
+#if !PLATFORM(WIN)
+    // Proxy authentication is handled by CFNetwork internally. We can get here if the user cancels
+    // CFNetwork authentication dialog, and we shouldn't ask the client to display another one in that case.
+    if (challenge.protectionSpace().isProxy()) {
+        // Cannot use receivedRequestToContinueWithoutCredential(), because current challenge is not yet set.
+        CFURLConnectionUseCredential(d->m_connection.get(), 0, challenge.cfURLAuthChallengeRef());
+        return;
+    }
+#endif
+
     if (!d->m_user.isNull() && !d->m_pass.isNull()) {
         RetainPtr<CFStringRef> user(AdoptCF, d->m_user.createCFString());
         RetainPtr<CFStringRef> pass(AdoptCF, d->m_pass.createCFString());

Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (99799 => 99800)


--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2011-11-10 02:40:13 UTC (rev 99799)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2011-11-10 02:48:40 UTC (rev 99800)
@@ -524,6 +524,16 @@
     // we make sure that is actually present
     ASSERT(challenge.nsURLAuthenticationChallenge());
 
+#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOWLEOPARD)
+    // Proxy authentication is handled by CFNetwork internally. We can get here if the user cancels
+    // CFNetwork authentication dialog, and we shouldn't ask the client to display another one in that case.
+    if (challenge.protectionSpace().isProxy()) {
+        // Cannot use receivedRequestToContinueWithoutCredential(), because current challenge is not yet set.
+        [challenge.sender() continueWithoutCredentialForAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
+        return;
+    }
+#endif
+
     if (!d->m_user.isNull() && !d->m_pass.isNull()) {
         NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:d->m_user
                                                                    password:d->m_pass
@@ -564,6 +574,9 @@
     d->m_currentWebChallenge = core(d->m_currentMacChallenge);
     d->m_currentWebChallenge.setAuthenticationClient(this);
 
+    // FIXME: Several concurrent requests can return with the an authentication challenge for the same protection space.
+    // We should avoid making additional client calls for the same protection space when already waiting for the user,
+    // because typing the same credentials several times is annoying.
     if (client())
         client()->didReceiveAuthenticationChallenge(this, d->m_currentWebChallenge);
 }

Modified: trunk/Source/WebKit2/ChangeLog (99799 => 99800)


--- trunk/Source/WebKit2/ChangeLog	2011-11-10 02:40:13 UTC (rev 99799)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-10 02:48:40 UTC (rev 99800)
@@ -1,3 +1,12 @@
+2011-11-09  Alexey Proskuryakov  <[email protected]>
+
+        <rdar://problem/10423024> WebProcess doesn't use AuthBrokerAgent for proxy credentials
+        https://bugs.webkit.org/show_bug.cgi?id=71964
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/com.apple.WebProcess.sb: Allow mach-lookup of com.apple.cfnetwork.AuthBrokerAgent.
+
 2011-11-09  Anders Carlsson  <[email protected]>
 
         Element::boundsInWindowSpace should be Element::boundsInRootViewSpace

Modified: trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb (99799 => 99800)


--- trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb	2011-11-10 02:40:13 UTC (rev 99799)
+++ trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb	2011-11-10 02:48:40 UTC (rev 99800)
@@ -167,6 +167,9 @@
        (global-name "com.apple.window_proxies")
        (global-name "com.apple.windowserver.active")
 
+        ;; FIXME: This will be superfluous once <rdar://problem/10420555> is fixed.
+       (global-name "com.apple.cfnetwork.AuthBrokerAgent")
+
        ;; FIXME: This should be removed when <rdar://problem/9276393> is fixed.
        (global-name "com.apple.metadata.mds"))
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to