Title: [254344] trunk
Revision
254344
Author
[email protected]
Date
2020-01-10 09:57:23 -0800 (Fri, 10 Jan 2020)

Log Message

Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=206046

Patch by Alex Christensen <[email protected]> on 2020-01-10
Reviewed by Youenn Fablet.

Source/WebKit:

This is needed for <rdar://problem/58464912>
Covered by API tests.

* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]):
(-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (254343 => 254344)


--- trunk/Source/WebKit/ChangeLog	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/ChangeLog	2020-01-10 17:57:23 UTC (rev 254344)
@@ -1,3 +1,25 @@
+2020-01-10  Alex Christensen  <[email protected]>
+
+        Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
+        https://bugs.webkit.org/show_bug.cgi?id=206046
+
+        Reviewed by Youenn Fablet.
+
+        This is needed for <rdar://problem/58464912>
+        Covered by API tests.
+
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
+        (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]):
+        (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::parameters):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
+        (WebKit::WebsiteDataStoreConfiguration::copy const):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
+        (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const):
+        (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled):
+
 2020-01-10  Brent Fulgham  <[email protected]>
 
         [macOS] Issue sandbox extension to "com.apple.nesessionmanager" prior to 10.15 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h (254343 => 254344)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h	2020-01-10 17:57:23 UTC (rev 254344)
@@ -48,6 +48,7 @@
 @property (nonatomic) NSUInteger perOriginStorageQuota WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, nullable, copy) NSString *boundInterfaceIdentifier WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic) BOOL allowsCellularAccess WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic) BOOL legacyTLSEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, nullable, copy) NSDictionary *proxyConfiguration WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, nullable, copy) NSString *dataConnectionServiceType WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm (254343 => 254344)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm	2020-01-10 17:57:23 UTC (rev 254344)
@@ -380,6 +380,16 @@
     _configuration->setAllowsCellularAccess(allows);
 }
 
+- (BOOL)legacyTLSEnabled
+{
+    return _configuration->legacyTLSEnabled();
+}
+
+- (void)setLegacyTLSEnabled:(BOOL)enable
+{
+    _configuration->setLegacyTLSEnabled(enable);
+}
+
 - (NSDictionary *)proxyConfiguration
 {
     return (__bridge NSDictionary *)_configuration->proxyConfiguration();

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (254343 => 254344)


--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-01-10 17:57:23 UTC (rev 254344)
@@ -72,7 +72,7 @@
     bool enableResourceLoadStatisticsDebugMode = false;
     auto thirdPartyCookieBlockingMode = WebCore::ThirdPartyCookieBlockingMode::All;
     auto firstPartyWebsiteDataRemovalMode = WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies;
-    bool enableLegacyTLS = false;
+    bool enableLegacyTLS = configuration().legacyTLSEnabled();
     if (id value = [defaults objectForKey:@"WebKitEnableLegacyTLS"])
         enableLegacyTLS = [value boolValue];
     if (!enableLegacyTLS) {

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp (254343 => 254344)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp	2020-01-10 17:57:23 UTC (rev 254344)
@@ -83,6 +83,7 @@
     copy->m_allLoadsBlockedByDeviceManagementRestrictionsForTesting = this->m_allLoadsBlockedByDeviceManagementRestrictionsForTesting;
     copy->m_boundInterfaceIdentifier = this->m_boundInterfaceIdentifier;
     copy->m_allowsCellularAccess = this->m_allowsCellularAccess;
+    copy->m_legacyTLSEnabled = this->m_legacyTLSEnabled;
     copy->m_dataConnectionServiceType = this->m_dataConnectionServiceType;
     copy->m_testingSessionEnabled = this->m_testingSessionEnabled;
     copy->m_testSpeedMultiplier = this->m_testSpeedMultiplier;

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h (254343 => 254344)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h	2020-01-10 17:57:23 UTC (rev 254344)
@@ -76,6 +76,9 @@
     bool allowsCellularAccess() const { return m_allowsCellularAccess; }
     void setAllowsCellularAccess(bool allows) { m_allowsCellularAccess = allows; }
 
+    bool legacyTLSEnabled() const { return m_legacyTLSEnabled; }
+    void setLegacyTLSEnabled(bool enabled) { m_legacyTLSEnabled = enabled; }
+
     bool fastServerTrustEvaluationEnabled() const { return m_fastServerTrustEvaluationEnabled; }
     void setFastServerTrustEvaluationEnabled(bool enabled) { m_fastServerTrustEvaluationEnabled = enabled; }
 
@@ -181,6 +184,7 @@
     bool m_deviceManagementRestrictionsEnabled { false };
     bool m_allLoadsBlockedByDeviceManagementRestrictionsForTesting { false };
     bool m_allowsCellularAccess { true };
+    bool m_legacyTLSEnabled { false };
     bool m_fastServerTrustEvaluationEnabled { false };
     bool m_serviceWorkerProcessTerminationDelayEnabled { true };
     bool m_testingSessionEnabled { false };

Modified: trunk/Tools/ChangeLog (254343 => 254344)


--- trunk/Tools/ChangeLog	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Tools/ChangeLog	2020-01-10 17:57:23 UTC (rev 254344)
@@ -1,5 +1,15 @@
 2020-01-10  Alex Christensen  <[email protected]>
 
+        Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
+        https://bugs.webkit.org/show_bug.cgi?id=206046
+
+        Reviewed by Youenn Fablet.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+        (TestWebKitAPI::TEST):
+
+2020-01-10  Alex Christensen  <[email protected]>
+
         Remove WebsiteDataStore::setCacheStorageDirectory which has been replaced by WebsiteDataStoreConfiguration::setCacheStorageDirectory
         https://bugs.webkit.org/show_bug.cgi?id=205841
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (254343 => 254344)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-01-10 17:52:55 UTC (rev 254343)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-01-10 17:57:23 UTC (rev 254344)
@@ -33,7 +33,9 @@
 #import "TestWKWebView.h"
 #import "WebCoreTestSupport.h"
 #import <WebKit/WKProcessPoolPrivate.h>
+#import <WebKit/WKWebsiteDataStorePrivate.h>
 #import <WebKit/WebKit.h>
+#import <WebKit/_WKWebsiteDataStoreConfiguration.h>
 #import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS_FAMILY)
@@ -195,6 +197,15 @@
         [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
         [delegate waitForDidFailProvisionalNavigation];
     }
+    {
+        TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
+        auto configuration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration]);
+        [configuration setLegacyTLSEnabled:YES];
+        auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:configuration.get()]);
+        auto webView = makeWebViewWith(dataStore.get());
+        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
+        [delegate waitForDidFinishNavigation];
+    }
     [[NSUserDefaults standardUserDefaults] setBool:YES forKey:defaultsKey];
     {
         TCPServer server(TCPServer::Protocol::HTTPS, [](SSL *ssl) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to