Changeset 260497 in webkit


Ignore:
Timestamp:
Apr 21, 2020 8:58:34 PM (4 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, reverting r260410.

Caused crashes in Safari

Reverted changeset:

"SPI clients using fastServerTrustEvaluationEnabled need SPI
to inform them of modern TLS negotiation"
https://bugs.webkit.org/show_bug.cgi?id=210533
https://trac.webkit.org/changeset/260410

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r260496 r260497  
     12020-04-21  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r260410.
     4
     5        Caused crashes in Safari
     6
     7        Reverted changeset:
     8
     9        "SPI clients using fastServerTrustEvaluationEnabled need SPI
     10        to inform them of modern TLS negotiation"
     11        https://bugs.webkit.org/show_bug.cgi?id=210533
     12        https://trac.webkit.org/changeset/260410
     13
    1142020-04-21  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/NetworkDataTask.h

    r260410 r260497  
    7272
    7373    virtual bool shouldCaptureExtraNetworkLoadMetrics() const { return false; }
    74 
    75     virtual void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) { }
    7674
    7775    void didCompleteWithError(const WebCore::ResourceError& error)
  • trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp

    r260496 r260497  
    3131#include "NetworkDataTaskBlob.h"
    3232#include "NetworkProcess.h"
    33 #include "NetworkProcessProxyMessages.h"
    3433#include "NetworkSession.h"
    3534#include "WebErrors.h"
     
    287286}
    288287
    289 void NetworkLoad::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)
    290 {
    291     m_networkProcess->send(Messages::NetworkProcessProxy::DidNegotiateModernTLS(m_parameters.webPageProxyID, challenge));
    292 }
    293 
    294288String NetworkLoad::description() const
    295289{
  • trunk/Source/WebKit/NetworkProcess/NetworkLoad.h

    r260410 r260497  
    8282    void cannotShowURL() final;
    8383    void wasBlockedByRestrictions() final;
    84     void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) final;
    8584
    8685    void notifyDidReceiveResponse(WebCore::ResourceResponse&&, NegotiatedLegacyTLS, ResponseCompletionHandler&&);
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h

    r260410 r260497  
    5454    void didSendData(uint64_t totalBytesSent, uint64_t totalBytesExpectedToSend);
    5555    void didReceiveChallenge(WebCore::AuthenticationChallenge&&, NegotiatedLegacyTLS, ChallengeCompletionHandler&&);
    56     void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&);
    5756    void didCompleteWithError(const WebCore::ResourceError&, const WebCore::NetworkLoadMetrics&);
    5857    void didReceiveResponse(WebCore::ResourceResponse&&, NegotiatedLegacyTLS, ResponseCompletionHandler&&);
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm

    r260410 r260497  
    317317        completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, { });
    318318    }
    319 }
    320 
    321 void NetworkDataTaskCocoa::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)
    322 {
    323     if (m_client)
    324         m_client->didNegotiateModernTLS(challenge);
    325319}
    326320
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r260410 r260497  
    675675        // Handle server trust evaluation at platform-level if requested, for performance reasons and to use ATS defaults.
    676676        if (sessionCocoa->fastServerTrustEvaluationEnabled() && negotiatedLegacyTLS == NegotiatedLegacyTLS::No) {
     677#if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
    677678            auto* networkDataTask = [self existingTask:task];
    678             if (networkDataTask)
    679                 networkDataTask->didNegotiateModernTLS(challenge);
    680 #if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
    681679            auto decisionHandler = makeBlockPtr([weakSelf = WeakObjCPtr<WKNetworkSessionDelegate>(self), sessionCocoa = makeWeakPtr(sessionCocoa), completionHandler = makeBlockPtr(completionHandler), taskIdentifier, networkDataTask = makeRefPtr(networkDataTask), negotiatedLegacyTLS](NSURLAuthenticationChallenge *challenge, OSStatus trustResult) mutable {
    682680                auto strongSelf = weakSelf.get();
  • trunk/Source/WebKit/UIProcess/API/APINavigationClient.h

    r260410 r260497  
    103103    virtual void didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy& challenge) { challenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling); }
    104104    virtual void shouldAllowLegacyTLS(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(true); }
    105     virtual void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) { }
    106105    virtual bool shouldBypassContentModeSafeguards() const { return false; }
    107106
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h

    r260410 r260497  
    8787
    8888- (void)_webView:(WKWebView *)webView authenticationChallenge:(NSURLAuthenticationChallenge *)challenge shouldAllowLegacyTLS:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    89 - (void)_webView:(WKWebView *)webView didNegotiateModernTLS:(NSURLAuthenticationChallenge *)challenge WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    9089
    9190- (void)_webViewDidBeginNavigationGesture:(WKWebView *)webView;
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h

    r260410 r260497  
    118118        void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy&) override;
    119119        void shouldAllowLegacyTLS(WebPageProxy&, AuthenticationChallengeProxy&, CompletionHandler<void(bool)>&&) final;
    120         void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) final;
    121120        bool processDidTerminate(WebPageProxy&, ProcessTerminationReason) override;
    122121        void processDidBecomeResponsive(WebPageProxy&) override;
     
    231230        bool webViewDidReceiveAuthenticationChallengeCompletionHandler : 1;
    232231        bool webViewAuthenticationChallengeShouldAllowLegacyTLS : 1;
    233         bool webViewDidNegotiateModernTLS : 1;
    234232        bool webViewWebContentProcessDidTerminate : 1;
    235233        bool webViewWebContentProcessDidTerminateWithReason : 1;
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r260485 r260497  
    7171#import "_WKSameDocumentNavigationTypeInternal.h"
    7272#import "_WKWebsitePoliciesInternal.h"
    73 #import <WebCore/AuthenticationMac.h>
    7473#import <WebCore/ContentRuleListResults.h>
    7574#import <WebCore/Credential.h>
     
    180179    m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler = [delegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)];
    181180    m_navigationDelegateMethods.webViewAuthenticationChallengeShouldAllowLegacyTLS = [delegate respondsToSelector:@selector(_webView:authenticationChallenge:shouldAllowLegacyTLS:)];
    182     m_navigationDelegateMethods.webViewDidNegotiateModernTLS = [delegate respondsToSelector:@selector(_webView:didNegotiateModernTLS:)];
    183181    m_navigationDelegateMethods.webViewWebContentProcessDidTerminate = [delegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)];
    184182    m_navigationDelegateMethods.webViewWebContentProcessDidTerminateWithReason = [delegate respondsToSelector:@selector(_webView:webContentProcessDidTerminateWithReason:)];
     
    10491047}
    10501048
    1051 void NavigationState::NavigationClient::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)
    1052 {
    1053     if (!m_navigationState.m_navigationDelegateMethods.webViewDidNegotiateModernTLS)
    1054         return;
    1055 
    1056     auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
    1057     if (!navigationDelegate)
    1058         return;
    1059 
    1060     [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView didNegotiateModernTLS:mac(challenge)];
    1061 }
    1062 
    10631049static _WKProcessTerminationReason wkProcessTerminationReason(ProcessTerminationReason reason)
    10641050{
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r260496 r260497  
    345345}
    346346
    347 void NetworkProcessProxy::didNegotiateModernTLS(WebPageProxyIdentifier pageID, const WebCore::AuthenticationChallenge& challenge)
    348 {
    349     if (auto* page = pageID ? WebProcessProxy::webPage(pageID) : nullptr)
    350         page->didNegotiateModernTLS(challenge);
    351 }
    352 
    353347void NetworkProcessProxy::didFetchWebsiteData(CallbackID callbackID, const WebsiteData& websiteData)
    354348{
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r260496 r260497  
    252252    void didReceiveAuthenticationChallenge(PAL::SessionID, WebPageProxyIdentifier, const Optional<WebCore::SecurityOriginData>&, WebCore::AuthenticationChallenge&&, bool, uint64_t challengeID);
    253253    void negotiatedLegacyTLS(WebPageProxyIdentifier);
    254     void didNegotiateModernTLS(WebPageProxyIdentifier, const WebCore::AuthenticationChallenge&);
    255254    void didFetchWebsiteData(CallbackID, const WebsiteData&);
    256255    void didDeleteWebsiteData(CallbackID);
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r260410 r260497  
    2424    DidReceiveAuthenticationChallenge(PAL::SessionID sessionID, WebKit::WebPageProxyIdentifier pageID, Optional<WebCore::SecurityOriginData> topOrigin, WebCore::AuthenticationChallenge challenge, bool negotiatedLegacyTLS, uint64_t challengeID)
    2525    NegotiatedLegacyTLS(WebKit::WebPageProxyIdentifier pageID)
    26     DidNegotiateModernTLS(WebKit::WebPageProxyIdentifier pageID, WebCore::AuthenticationChallenge challenge)
    2726
    2827    DidFetchWebsiteData(WebKit::CallbackID callbackID, struct WebKit::WebsiteData websiteData)
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r260496 r260497  
    79417941}
    79427942
    7943 void WebPageProxy::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)
    7944 {
    7945     m_navigationClient->didNegotiateModernTLS(challenge);
    7946 }
    7947 
    79487943void WebPageProxy::exceededDatabaseQuota(FrameIdentifier frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&& reply)
    79497944{
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r260410 r260497  
    13701370    void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&, NegotiatedLegacyTLS);
    13711371    void negotiatedLegacyTLS();
    1372     void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&);
    13731372
    13741373    SpellDocumentTag spellDocumentTag();
  • trunk/Tools/ChangeLog

    r260491 r260497  
     12020-04-21  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r260410.
     4
     5        Caused crashes in Safari
     6
     7        Reverted changeset:
     8
     9        "SPI clients using fastServerTrustEvaluationEnabled need SPI
     10        to inform them of modern TLS negotiation"
     11        https://bugs.webkit.org/show_bug.cgi?id=210533
     12        https://trac.webkit.org/changeset/260410
     13
    1142020-04-21  Cathie Chen  <cathiechen@igalia.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm

    r260410 r260497  
    7474- (void)waitForDidFinishNavigation;
    7575- (void)waitForDidFailProvisionalNavigation;
    76 - (NSURLAuthenticationChallenge *)waitForDidNegotiateModernTLS;
    7776- (bool)receivedShouldAllowLegacyTLS;
    7877@property (nonatomic) bool shouldAllowLegacyTLS;
     
    8382    bool _navigationFailed;
    8483    bool _receivedShouldAllowLegacyTLS;
    85     RetainPtr<NSURLAuthenticationChallenge> _negotiatedModernTLS;
    8684}
    8785
     
    9694    while (!_navigationFailed)
    9795        TestWebKitAPI::Util::spinRunLoop();
    98 }
    99 
    100 - (NSURLAuthenticationChallenge *)waitForDidNegotiateModernTLS
    101 {
    102     while (!_negotiatedModernTLS)
    103         TestWebKitAPI::Util::spinRunLoop();
    104     return _negotiatedModernTLS.autorelease();
    10596}
    10697
     
    130121    _receivedShouldAllowLegacyTLS = true;
    131122    completionHandler([self shouldAllowLegacyTLS]);
    132 }
    133 
    134 - (void)_webView:(WKWebView *)webView didNegotiateModernTLS:(NSURLAuthenticationChallenge *)challenge
    135 {
    136     _negotiatedModernTLS = challenge;
    137123}
    138124
     
    384370}
    385371
    386 TEST(TLSVersion, DidNegotiateModernTLS)
    387 {
    388     HTTPServer server({
    389         { "/", { "hello" }}
    390     }, HTTPServer::Protocol::Https);
    391 
    392     auto delegate = adoptNS([TLSNavigationDelegate new]);
    393     auto configuration = adoptNS([WKWebViewConfiguration new]);
    394     auto dataStoreConfiguration = adoptNS([_WKWebsiteDataStoreConfiguration new]);
    395     [dataStoreConfiguration setFastServerTrustEvaluationEnabled:YES];
    396     [configuration setWebsiteDataStore:[[[WKWebsiteDataStore alloc] _initWithConfiguration:dataStoreConfiguration.get()] autorelease]];
    397     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    398     [webView setNavigationDelegate:delegate.get()];
    399     [webView loadRequest:server.request()];
    400     NSURLAuthenticationChallenge *challenge = [delegate waitForDidNegotiateModernTLS];
    401     EXPECT_WK_STREQ(challenge.protectionSpace.host, "127.0.0.1");
    402     EXPECT_EQ(challenge.protectionSpace.port, server.port());
    403 }
    404 
    405372TEST(TLSVersion, BackForwardHasOnlySecureContent)
    406373{
Note: See TracChangeset for help on using the changeset viewer.