⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245215 in webkit


Ignore:
Timestamp:
May 12, 2019, 4:05:20 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
https://bugs.webkit.org/show_bug.cgi?id=197650

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-05-12
Reviewed by Fujii Hironori.

Source/WebCore:

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):

Source/WebKit:

  • NetworkProcess/curl/NetworkDataTaskCurl.cpp:

(WebKit::NetworkDataTaskCurl::restartWithCredential):

LayoutTests:

  • 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:
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245212 r245215  
     12019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
     4        https://bugs.webkit.org/show_bug.cgi?id=197650
     5
     6        Reviewed by Fujii Hironori.
     7
     8        * TestExpectations:
     9        * http/tests/resources/basic-auth.php: Added.
     10        * http/tests/ssl/curl/certificate-and-authentication-expected.txt: Added.
     11        * http/tests/ssl/curl/certificate-and-authentication.html: Added.
     12        * platform/wincairo-wk1/TestExpectations:
     13        * platform/wincairo/TestExpectations:
     14
    1152019-05-11  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/LayoutTests/TestExpectations

    r245212 r245215  
    5353http/tests/gzip-content-encoding [ Skip ]
    5454http/tests/cookies/same-site [ Skip ]
     55http/tests/ssl/curl [ Skip ]
    5556system-preview [ Skip ]
    5657editing/images [ Skip ]
  • trunk/LayoutTests/platform/wincairo-wk1/TestExpectations

    r244250 r245215  
    2222
    2323# Server trust evaluation only supported in WK2.
     24http/tests/ssl/curl/certificate-and-authentication.html [ Skip ]
    2425http/tests/ssl/iframe-upgrade.https.html [ Skip ]
    2526http/tests/ssl/mixedContent/insecure-websocket.html [ Failure ]
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r244908 r245215  
    949949http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Pass ]
    950950
     951http/tests/ssl/curl/certificate-and-authentication.html [ Pass ]
    951952http/tests/ssl/media-stream [ Skip ]
    952953
  • trunk/Source/WebCore/ChangeLog

    r245212 r245215  
     12019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
     4        https://bugs.webkit.org/show_bug.cgi?id=197650
     5
     6        Reviewed by Fujii Hironori.
     7
     8        When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
     9        Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
     10        This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
     11
     12        Test: http/tests/ssl/curl/certificate-and-authentication.html
     13
     14        * platform/network/curl/CurlRequest.h:
     15        (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
     16
    1172019-05-11  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/platform/network/curl/CurlRequest.h

    r244684 r245215  
    7575    WEBCORE_EXPORT void setAuthenticationScheme(ProtectionSpaceAuthenticationScheme);
    7676    WEBCORE_EXPORT void setUserPass(const String&, const String&);
     77    bool isServerTrustEvaluationDisabled() { return m_shouldDisableServerTrustEvaluation; }
    7778    void disableServerTrustEvaluation() { m_shouldDisableServerTrustEvaluation = true; }
    7879    void setStartTime(const MonotonicTime& startTime) { m_requestStartTime = startTime; }
  • trunk/Source/WebKit/ChangeLog

    r245198 r245215  
     12019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
     2
     3        [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
     4        https://bugs.webkit.org/show_bug.cgi?id=197650
     5
     6        Reviewed by Fujii Hironori.
     7
     8        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
     9        (WebKit::NetworkDataTaskCurl::restartWithCredential):
     10
    1112019-05-10  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp

    r243654 r245215  
    426426
    427427    auto previousRequest = m_curlRequest->resourceRequest();
     428    auto shouldDisableServerTrustEvaluation = protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested || m_curlRequest->isServerTrustEvaluationDisabled();
    428429    m_curlRequest->cancel();
    429430
     
    431432    m_curlRequest->setAuthenticationScheme(protectionSpace.authenticationScheme());
    432433    m_curlRequest->setUserPass(credential.user(), credential.password());
    433     if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested)
     434    if (shouldDisableServerTrustEvaluation)
    434435        m_curlRequest->disableServerTrustEvaluation();
    435436    m_curlRequest->setStartTime(m_startTime);
Note: See TracChangeset for help on using the changeset viewer.