WebKit Bugzilla
Attachment 369456 Details for
Bug 197650
: [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197650-20190509104523.patch (text/plain), 10.00 KB, created by
Takashi Komori
on 2019-05-08 18:48:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-05-08 18:48:04 PDT
Size:
10.00 KB
patch
obsolete
>Subversion Revision: 244918 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 144e79b4ccc0390cb728bd96fcf2bf7fa9a9c27a..803cc8efc8a6d1e4292404ca58eb5722e50359df 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-08 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/misc/certificate-and-authentication.html >+ >+ * platform/network/curl/CurlRequest.h: >+ (WebCore::CurlRequest::isServerTrustEvaluationDisabled): >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > Cache.add and Cache.addAll should compute a correct response body size >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 5200b51b836528df35780edb583d3e620476336f..39e3cc236effa7b742f785a8410b06d394d0b2d5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-08 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/curl/NetworkDataTaskCurl.cpp: >+ (WebKit::NetworkDataTaskCurl::restartWithCredential): >+ > 2019-05-03 Brent Fulgham <bfulgham@apple.com> > > Use more efficient path resolution logic >diff --git a/Source/WebCore/platform/network/curl/CurlRequest.h b/Source/WebCore/platform/network/curl/CurlRequest.h >index d13766e3bf4e3b025b8e8784f2109fb1355b8c28..91d4dc9b057656d86426a1f4d9df40790129d697 100644 >--- a/Source/WebCore/platform/network/curl/CurlRequest.h >+++ b/Source/WebCore/platform/network/curl/CurlRequest.h >@@ -74,6 +74,7 @@ public: > void invalidateClient(); > WEBCORE_EXPORT void setAuthenticationScheme(ProtectionSpaceAuthenticationScheme); > WEBCORE_EXPORT void setUserPass(const String&, const String&); >+ bool isServerTrustEvaluationDisabled() { return m_shouldDisableServerTrustEvaluation; } > void disableServerTrustEvaluation() { m_shouldDisableServerTrustEvaluation = true; } > void setStartTime(const MonotonicTime& startTime) { m_requestStartTime = startTime; } > >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >index 36a6b3926c1b2a868d807f14738ed968dbd2cc6b..77633ba44822e4bbc82ce3cb27f724af9679d350 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >@@ -425,12 +425,13 @@ void NetworkDataTaskCurl::restartWithCredential(const ProtectionSpace& protectio > ASSERT(m_curlRequest); > > auto previousRequest = m_curlRequest->resourceRequest(); >+ auto shouldDisableServerTrustEvaluation = protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested || m_curlRequest->isServerTrustEvaluationDisabled(); > m_curlRequest->cancel(); > > m_curlRequest = createCurlRequest(WTFMove(previousRequest), RequestStatus::ReusedRequest); > m_curlRequest->setAuthenticationScheme(protectionSpace.authenticationScheme()); > m_curlRequest->setUserPass(credential.user(), credential.password()); >- if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) >+ if (shouldDisableServerTrustEvaluation) > m_curlRequest->disableServerTrustEvaluation(); > m_curlRequest->setStartTime(m_startTime); > m_curlRequest->start(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index beb63bc2b73e800ee6fd61bea0f4a774745dc7bc..c3cb88465c436c7e66c67553f90cb21566528436 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-05-08 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. >+ https://bugs.webkit.org/show_bug.cgi?id=197650 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: >+ * http/tests/misc/certificate-and-authentication-expected.txt: Added. >+ * http/tests/misc/certificate-and-authentication.html: Added. >+ * http/tests/misc/resources/certificate-and-authentication.php: Added. >+ * platform/wincairo-wk1/TestExpectations: >+ * platform/wincairo/TestExpectations: >+ > 2019-05-03 Youenn Fablet <youenn@apple.com> > > Cache.add and Cache.addAll should compute a correct response body size >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 101446844d438e28c51fc7166154999e569128ec..81364f1648865a3df3c2890544ac563f4a912f86 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -447,6 +447,9 @@ fast/animation/request-animation-frame-in-two-pages.html [ Skip ] > imported/w3c/web-platform-tests/pointerevents [ Skip ] > pointerevents [ Skip ] > >+# testRunner.serverTrustEvaluationCallbackCallsCount only works in WebKit2 >+http/tests/misc/certificate-and-authentication.html [ Skip ] >+ > #////////////////////////////////////////////////////////////////////////////////////////// > # End platform-specific tests. > #////////////////////////////////////////////////////////////////////////////////////////// >diff --git a/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt b/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d474190b6dc12151aff4c800f6592a0d602ea20d >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt >@@ -0,0 +1,4 @@ >+localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with user:pass >+PASS >+ >+ >diff --git a/LayoutTests/http/tests/misc/certificate-and-authentication.html b/LayoutTests/http/tests/misc/certificate-and-authentication.html >new file mode 100644 >index 0000000000000000000000000000000000000000..336924bd112dda2907ffc4132e7a3dfb7835fb2c >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication.html >@@ -0,0 +1,41 @@ >+<html> >+<head> >+<!-- This is a test for https://bugs.webkit.org/show_bug.cgi?id=197650 --> >+<script> >+var currentCallbackCounts = 0; >+ >+function runTest() { >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ testRunner.setAllowsAnySSLCertificate(true); >+ testRunner.setHandlesAuthenticationChallenges(true); >+ testRunner.setAuthenticationUsername("user"); >+ testRunner.setAuthenticationPassword("pass"); >+ >+ currentCallbackCounts = testRunner.serverTrustEvaluationCallbackCallsCount; >+ } >+ >+ var iframe = document.createElement("iframe"); >+ iframe.src = "https://localhost:8443/misc/resources/certificate-and-authentication.php"; >+ document.body.appendChild(iframe); >+} >+ >+window.onmessage = function() { >+ if (window.testRunner) { >+ var callbackCounts = testRunner.serverTrustEvaluationCallbackCallsCount - currentCallbackCounts; >+ >+ if (callbackCounts == 1) >+ document.getElementById('result').innerText = "PASS"; >+ else >+ document.getElementById('result').innerText = "FAIL (" + callbackCounts + ")"; >+ >+ testRunner.notifyDone(); >+ } >+} >+</script> >+</head> >+<body onload="runTest()"> >+<p id="result">RUNNING</p> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php b/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php >new file mode 100644 >index 0000000000000000000000000000000000000000..bf34e282987ebe8b115abbc83b3d62aac44f6326 >--- /dev/null >+++ b/LayoutTests/http/tests/misc/resources/certificate-and-authentication.php >@@ -0,0 +1,14 @@ >+<?php >+ header("Cache-Control: no-cache, no-store"); >+ >+ if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != 'user' || $_SERVER['PHP_AUTH_PW'] != 'pass') { >+ header('WWW-Authenticate: Basic realm="WebKit test - certificate-and-authentication"'); >+ header('HTTP/1.0 401 Unauthorized'); >+ exit; >+ } >+?> >+ >+<!DOCTYPE html> >+<script> >+parent.postMessage("loaded", "*"); >+</script> >diff --git a/LayoutTests/platform/wincairo-wk1/TestExpectations b/LayoutTests/platform/wincairo-wk1/TestExpectations >index 54a9bb77921ab0f2f33353e8b2be2c5bd9772bb6..46bb3ee424ecec6743fb8d4a19897d252008e5ca 100644 >--- a/LayoutTests/platform/wincairo-wk1/TestExpectations >+++ b/LayoutTests/platform/wincairo-wk1/TestExpectations >@@ -21,6 +21,7 @@ http/tests/security/cookies/third-party-cookie-blocking-user-action.html [ Skip > http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Skip ] > > # Server trust evaluation only supported in WK2. >+http/tests/misc/certificate-and-authentication.html [ Skip ] > http/tests/ssl/iframe-upgrade.https.html [ Skip ] > http/tests/ssl/mixedContent/insecure-websocket.html [ Failure ] > http/tests/ssl/upgrade-origin-usage.html [ Failure ] >diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations >index 3291973db7b942474bd61310f258da52a44990fd..1d71400f4caa58f64b1ea32ae40e1ce3c78ec2c8 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -903,6 +903,7 @@ http/tests/misc/authentication-redirect-2/authentication-sent-to-redirect-same-o > http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html [ Failure ] > http/tests/misc/authentication-redirect-4/authentication-sent-to-redirect-same-origin-url.html [ Failure ] > http/tests/misc/bubble-drag-events.html [ Crash Pass ] >+http/tests/misc/certificate-and-authentication.html [ Pass ] > http/tests/misc/favicon-loads-with-icon-loading-override.html [ Failure ] > http/tests/misc/form-submit-file-cross-site.html [ Skip ] > http/tests/misc/link-rel-icon-beforeload.html [ Failure ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197650
:
369257
|
369262
|
369265
|
369269
|
369270
|
369272
|
369456
|
369459
|
369469
|
369540
|
369649