WebKit Bugzilla
Attachment 369540 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-20190510121422.patch (text/plain), 9.61 KB, created by
Takashi Komori
on 2019-05-09 20:17:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-05-09 20:17:02 PDT
Size:
9.61 KB
patch
obsolete
>Subversion Revision: 244918 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 144e79b4ccc0390cb728bd96fcf2bf7fa9a9c27a..be3c83481a48b71ba000f41851c1535a208a49be 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-09 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!). >+ >+ When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs, >+ Curl port calls extra didReceiveAuthenticationChallenge unnecessarily. >+ This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential. >+ >+ 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..4650a8c84ed7d9f70e734d1a939d1e521d2ba0d4 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-09 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..6461d2d57f7a03a51c9ef03139db41490e8a615f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-09 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. >+ * 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..b51bdbd970dc8d91b86c39de71bef4f09c429456 >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication-expected.txt >@@ -0,0 +1,4 @@ >+localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with user: >+ >+PASS Certificate validation and basic authentication >+ >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..55814e3446c2edf32e92b3678b2f76d3d3875624 >--- /dev/null >+++ b/LayoutTests/http/tests/misc/certificate-and-authentication.html >@@ -0,0 +1,42 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<!-- This is a test for https://bugs.webkit.org/show_bug.cgi?id=197650 --> >+<title>Certificate validation and basic authentication</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<script> >+function with_iframe(url) { >+ return new Promise(function(resolve) { >+ var frame = document.createElement('iframe'); >+ frame.className = 'test-iframe'; >+ frame.src = url; >+ frame.onload = function() { resolve(frame); }; >+ document.body.appendChild(frame); >+ }); >+} >+ >+async function doTest() >+{ >+ assert_true(!!window.testRunner, "Test requires testRunner"); >+ >+ window.testRunner.setAllowsAnySSLCertificate(true); >+ window.testRunner.setHandlesAuthenticationChallenges(true); >+ window.testRunner.setAuthenticationUsername("user"); >+ window.testRunner.setAuthenticationPassword(""); >+ >+ const currentCallbackCounts = window.testRunner.serverTrustEvaluationCallbackCallsCount; >+ >+ const iframe = await with_iframe("https://localhost:8443/xmlhttprequest/resources/basic-auth/basic-auth.php?uid=user"); >+ iframe.remove(); >+ >+ assert_equals(window.testRunner.serverTrustEvaluationCallbackCallsCount - currentCallbackCounts, 1); >+} >+ >+doTest().then(done, (e) => { assert_unreached("test failed: " + e); done(); }); >+ >+</script> >+</body> >+</html> >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