WebKit Bugzilla
Attachment 369649 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-20190511182017.patch (text/plain), 9.92 KB, created by
Takashi Komori
on 2019-05-11 02:22:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-05-11 02:22:56 PDT
Size:
9.92 KB
patch
obsolete
>Subversion Revision: 244918 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 144e79b4ccc0390cb728bd96fcf2bf7fa9a9c27a..656b9052dd5ce6237518c6ad6195f4689c868614 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-11 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/ssl/curl/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..a8f1a166fab8671732f88fbe867223b1d121454d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-11 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..0eae9c38a1fbcaf4660bf9eac667ee45c4d28050 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-05-11 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/resources/basic-auth.php: Added. >+ * http/tests/ssl/curl/certificate-and-authentication-expected.txt: Added. >+ * http/tests/ssl/curl/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..b709535d380d2937a1b56526686b49d145c825a9 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -52,6 +52,7 @@ http/tests/events/touch/ios [ Skip ] > http/tests/preload/viewport [ Skip ] > http/tests/gzip-content-encoding [ Skip ] > http/tests/cookies/same-site [ Skip ] >+http/tests/ssl/curl [ Skip ] > system-preview [ Skip ] > editing/images [ Skip ] > pointerevents/ios [ Skip ] >diff --git a/LayoutTests/http/tests/resources/basic-auth.php b/LayoutTests/http/tests/resources/basic-auth.php >new file mode 100644 >index 0000000000000000000000000000000000000000..95dce5df8a3501f4f594d398c7f94649a434cd48 >--- /dev/null >+++ b/LayoutTests/http/tests/resources/basic-auth.php >@@ -0,0 +1,10 @@ >+<?php >+ if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_REQUEST['uid']) || ($_REQUEST['uid'] != $_SERVER['PHP_AUTH_USER'])) { >+ header('WWW-Authenticate: Basic realm="WebKit Test Realm"'); >+ header('HTTP/1.0 401 Unauthorized'); >+ echo 'Authentication canceled'; >+ exit; >+ } else { >+ echo "User: {$_SERVER['PHP_AUTH_USER']}, password: {$_SERVER['PHP_AUTH_PW']}."; >+ } >+?> >diff --git a/LayoutTests/http/tests/ssl/curl/certificate-and-authentication-expected.txt b/LayoutTests/http/tests/ssl/curl/certificate-and-authentication-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b51bdbd970dc8d91b86c39de71bef4f09c429456 >--- /dev/null >+++ b/LayoutTests/http/tests/ssl/curl/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/ssl/curl/certificate-and-authentication.html b/LayoutTests/http/tests/ssl/curl/certificate-and-authentication.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3d69088c5c8c212f50b6415932ee9d95dda807b1 >--- /dev/null >+++ b/LayoutTests/http/tests/ssl/curl/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/resources/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..97a11f4b9276be3f74bbb1390aff8e956ad9198e 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/ssl/curl/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..4ee7e05efb53e00d69fd3d1dd6b9e1c408136836 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -948,6 +948,7 @@ http/tests/security/cookies/third-party-cookie-blocking-redirect.html [ Pass ] > http/tests/security/cookies/third-party-cookie-blocking-user-action.html [ Pass ] > http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Pass ] > >+http/tests/ssl/curl/certificate-and-authentication.html [ Pass ] > http/tests/ssl/media-stream [ Skip ] > > [ Debug ] http/tests/storage/callbacks-are-called-in-correct-context.html [ Skip ]
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