Changeset 260497 in webkit
- Timestamp:
- Apr 21, 2020 8:58:34 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r260496 r260497 1 2020-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 1 14 2020-04-21 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebKit/NetworkProcess/NetworkDataTask.h
r260410 r260497 72 72 73 73 virtual bool shouldCaptureExtraNetworkLoadMetrics() const { return false; } 74 75 virtual void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) { }76 74 77 75 void didCompleteWithError(const WebCore::ResourceError& error) -
trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp
r260496 r260497 31 31 #include "NetworkDataTaskBlob.h" 32 32 #include "NetworkProcess.h" 33 #include "NetworkProcessProxyMessages.h"34 33 #include "NetworkSession.h" 35 34 #include "WebErrors.h" … … 287 286 } 288 287 289 void NetworkLoad::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)290 {291 m_networkProcess->send(Messages::NetworkProcessProxy::DidNegotiateModernTLS(m_parameters.webPageProxyID, challenge));292 }293 294 288 String NetworkLoad::description() const 295 289 { -
trunk/Source/WebKit/NetworkProcess/NetworkLoad.h
r260410 r260497 82 82 void cannotShowURL() final; 83 83 void wasBlockedByRestrictions() final; 84 void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) final;85 84 86 85 void notifyDidReceiveResponse(WebCore::ResourceResponse&&, NegotiatedLegacyTLS, ResponseCompletionHandler&&); -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h
r260410 r260497 54 54 void didSendData(uint64_t totalBytesSent, uint64_t totalBytesExpectedToSend); 55 55 void didReceiveChallenge(WebCore::AuthenticationChallenge&&, NegotiatedLegacyTLS, ChallengeCompletionHandler&&); 56 void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&);57 56 void didCompleteWithError(const WebCore::ResourceError&, const WebCore::NetworkLoadMetrics&); 58 57 void didReceiveResponse(WebCore::ResourceResponse&&, NegotiatedLegacyTLS, ResponseCompletionHandler&&); -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r260410 r260497 317 317 completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, { }); 318 318 } 319 }320 321 void NetworkDataTaskCocoa::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)322 {323 if (m_client)324 m_client->didNegotiateModernTLS(challenge);325 319 } 326 320 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r260410 r260497 675 675 // Handle server trust evaluation at platform-level if requested, for performance reasons and to use ATS defaults. 676 676 if (sessionCocoa->fastServerTrustEvaluationEnabled() && negotiatedLegacyTLS == NegotiatedLegacyTLS::No) { 677 #if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE) 677 678 auto* networkDataTask = [self existingTask:task]; 678 if (networkDataTask)679 networkDataTask->didNegotiateModernTLS(challenge);680 #if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)681 679 auto decisionHandler = makeBlockPtr([weakSelf = WeakObjCPtr<WKNetworkSessionDelegate>(self), sessionCocoa = makeWeakPtr(sessionCocoa), completionHandler = makeBlockPtr(completionHandler), taskIdentifier, networkDataTask = makeRefPtr(networkDataTask), negotiatedLegacyTLS](NSURLAuthenticationChallenge *challenge, OSStatus trustResult) mutable { 682 680 auto strongSelf = weakSelf.get(); -
trunk/Source/WebKit/UIProcess/API/APINavigationClient.h
r260410 r260497 103 103 virtual void didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy& challenge) { challenge.listener().completeChallenge(WebKit::AuthenticationChallengeDisposition::PerformDefaultHandling); } 104 104 virtual void shouldAllowLegacyTLS(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(true); } 105 virtual void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) { }106 105 virtual bool shouldBypassContentModeSafeguards() const { return false; } 107 106 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h
r260410 r260497 87 87 88 88 - (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));90 89 91 90 - (void)_webViewDidBeginNavigationGesture:(WKWebView *)webView; -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h
r260410 r260497 118 118 void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy&) override; 119 119 void shouldAllowLegacyTLS(WebPageProxy&, AuthenticationChallengeProxy&, CompletionHandler<void(bool)>&&) final; 120 void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&) final;121 120 bool processDidTerminate(WebPageProxy&, ProcessTerminationReason) override; 122 121 void processDidBecomeResponsive(WebPageProxy&) override; … … 231 230 bool webViewDidReceiveAuthenticationChallengeCompletionHandler : 1; 232 231 bool webViewAuthenticationChallengeShouldAllowLegacyTLS : 1; 233 bool webViewDidNegotiateModernTLS : 1;234 232 bool webViewWebContentProcessDidTerminate : 1; 235 233 bool webViewWebContentProcessDidTerminateWithReason : 1; -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r260485 r260497 71 71 #import "_WKSameDocumentNavigationTypeInternal.h" 72 72 #import "_WKWebsitePoliciesInternal.h" 73 #import <WebCore/AuthenticationMac.h>74 73 #import <WebCore/ContentRuleListResults.h> 75 74 #import <WebCore/Credential.h> … … 180 179 m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler = [delegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)]; 181 180 m_navigationDelegateMethods.webViewAuthenticationChallengeShouldAllowLegacyTLS = [delegate respondsToSelector:@selector(_webView:authenticationChallenge:shouldAllowLegacyTLS:)]; 182 m_navigationDelegateMethods.webViewDidNegotiateModernTLS = [delegate respondsToSelector:@selector(_webView:didNegotiateModernTLS:)];183 181 m_navigationDelegateMethods.webViewWebContentProcessDidTerminate = [delegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)]; 184 182 m_navigationDelegateMethods.webViewWebContentProcessDidTerminateWithReason = [delegate respondsToSelector:@selector(_webView:webContentProcessDidTerminateWithReason:)]; … … 1049 1047 } 1050 1048 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 1063 1049 static _WKProcessTerminationReason wkProcessTerminationReason(ProcessTerminationReason reason) 1064 1050 { -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r260496 r260497 345 345 } 346 346 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 353 347 void NetworkProcessProxy::didFetchWebsiteData(CallbackID callbackID, const WebsiteData& websiteData) 354 348 { -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r260496 r260497 252 252 void didReceiveAuthenticationChallenge(PAL::SessionID, WebPageProxyIdentifier, const Optional<WebCore::SecurityOriginData>&, WebCore::AuthenticationChallenge&&, bool, uint64_t challengeID); 253 253 void negotiatedLegacyTLS(WebPageProxyIdentifier); 254 void didNegotiateModernTLS(WebPageProxyIdentifier, const WebCore::AuthenticationChallenge&);255 254 void didFetchWebsiteData(CallbackID, const WebsiteData&); 256 255 void didDeleteWebsiteData(CallbackID); -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
r260410 r260497 24 24 DidReceiveAuthenticationChallenge(PAL::SessionID sessionID, WebKit::WebPageProxyIdentifier pageID, Optional<WebCore::SecurityOriginData> topOrigin, WebCore::AuthenticationChallenge challenge, bool negotiatedLegacyTLS, uint64_t challengeID) 25 25 NegotiatedLegacyTLS(WebKit::WebPageProxyIdentifier pageID) 26 DidNegotiateModernTLS(WebKit::WebPageProxyIdentifier pageID, WebCore::AuthenticationChallenge challenge)27 26 28 27 DidFetchWebsiteData(WebKit::CallbackID callbackID, struct WebKit::WebsiteData websiteData) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r260496 r260497 7941 7941 } 7942 7942 7943 void WebPageProxy::didNegotiateModernTLS(const WebCore::AuthenticationChallenge& challenge)7944 {7945 m_navigationClient->didNegotiateModernTLS(challenge);7946 }7947 7948 7943 void 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) 7949 7944 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r260410 r260497 1370 1370 void didReceiveAuthenticationChallengeProxy(Ref<AuthenticationChallengeProxy>&&, NegotiatedLegacyTLS); 1371 1371 void negotiatedLegacyTLS(); 1372 void didNegotiateModernTLS(const WebCore::AuthenticationChallenge&);1373 1372 1374 1373 SpellDocumentTag spellDocumentTag(); -
trunk/Tools/ChangeLog
r260491 r260497 1 2020-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 1 14 2020-04-21 Cathie Chen <cathiechen@igalia.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm
r260410 r260497 74 74 - (void)waitForDidFinishNavigation; 75 75 - (void)waitForDidFailProvisionalNavigation; 76 - (NSURLAuthenticationChallenge *)waitForDidNegotiateModernTLS;77 76 - (bool)receivedShouldAllowLegacyTLS; 78 77 @property (nonatomic) bool shouldAllowLegacyTLS; … … 83 82 bool _navigationFailed; 84 83 bool _receivedShouldAllowLegacyTLS; 85 RetainPtr<NSURLAuthenticationChallenge> _negotiatedModernTLS;86 84 } 87 85 … … 96 94 while (!_navigationFailed) 97 95 TestWebKitAPI::Util::spinRunLoop(); 98 }99 100 - (NSURLAuthenticationChallenge *)waitForDidNegotiateModernTLS101 {102 while (!_negotiatedModernTLS)103 TestWebKitAPI::Util::spinRunLoop();104 return _negotiatedModernTLS.autorelease();105 96 } 106 97 … … 130 121 _receivedShouldAllowLegacyTLS = true; 131 122 completionHandler([self shouldAllowLegacyTLS]); 132 }133 134 - (void)_webView:(WKWebView *)webView didNegotiateModernTLS:(NSURLAuthenticationChallenge *)challenge135 {136 _negotiatedModernTLS = challenge;137 123 } 138 124 … … 384 370 } 385 371 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 405 372 TEST(TLSVersion, BackForwardHasOnlySecureContent) 406 373 {
Note: See TracChangeset
for help on using the changeset viewer.