Changeset 254344 in webkit


Ignore:
Timestamp:
Jan 10, 2020 9:57:23 AM (4 years ago)
Author:
commit-queue@webkit.org
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 <achristensen@webkit.org> 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):

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r254343 r254344  
     12020-01-10  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
     4        https://bugs.webkit.org/show_bug.cgi?id=206046
     5
     6        Reviewed by Youenn Fablet.
     7
     8        This is needed for <rdar://problem/58464912>
     9        Covered by API tests.
     10
     11        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
     12        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
     13        (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]):
     14        (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]):
     15        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     16        (WebKit::WebsiteDataStore::parameters):
     17        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
     18        (WebKit::WebsiteDataStoreConfiguration::copy const):
     19        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
     20        (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const):
     21        (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled):
     22
    1232020-01-10  Brent Fulgham  <bfulgham@apple.com>
    224
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h

    r253277 r254344  
    4949@property (nonatomic, nullable, copy) NSString *boundInterfaceIdentifier WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    5050@property (nonatomic) BOOL allowsCellularAccess WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     51@property (nonatomic) BOOL legacyTLSEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    5152@property (nonatomic, nullable, copy) NSDictionary *proxyConfiguration WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    5253@property (nonatomic, nullable, copy) NSString *dataConnectionServiceType WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm

    r253277 r254344  
    381381}
    382382
     383- (BOOL)legacyTLSEnabled
     384{
     385    return _configuration->legacyTLSEnabled();
     386}
     387
     388- (void)setLegacyTLSEnabled:(BOOL)enable
     389{
     390    _configuration->setLegacyTLSEnabled(enable);
     391}
     392
    383393- (NSDictionary *)proxyConfiguration
    384394{
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r254296 r254344  
    7373    auto thirdPartyCookieBlockingMode = WebCore::ThirdPartyCookieBlockingMode::All;
    7474    auto firstPartyWebsiteDataRemovalMode = WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies;
    75     bool enableLegacyTLS = false;
     75    bool enableLegacyTLS = configuration().legacyTLSEnabled();
    7676    if (id value = [defaults objectForKey:@"WebKitEnableLegacyTLS"])
    7777        enableLegacyTLS = [value boolValue];
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp

    r253277 r254344  
    8484    copy->m_boundInterfaceIdentifier = this->m_boundInterfaceIdentifier;
    8585    copy->m_allowsCellularAccess = this->m_allowsCellularAccess;
     86    copy->m_legacyTLSEnabled = this->m_legacyTLSEnabled;
    8687    copy->m_dataConnectionServiceType = this->m_dataConnectionServiceType;
    8788    copy->m_testingSessionEnabled = this->m_testingSessionEnabled;
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h

    r253277 r254344  
    7676    bool allowsCellularAccess() const { return m_allowsCellularAccess; }
    7777    void setAllowsCellularAccess(bool allows) { m_allowsCellularAccess = allows; }
     78
     79    bool legacyTLSEnabled() const { return m_legacyTLSEnabled; }
     80    void setLegacyTLSEnabled(bool enabled) { m_legacyTLSEnabled = enabled; }
    7881
    7982    bool fastServerTrustEvaluationEnabled() const { return m_fastServerTrustEvaluationEnabled; }
     
    182185    bool m_allLoadsBlockedByDeviceManagementRestrictionsForTesting { false };
    183186    bool m_allowsCellularAccess { true };
     187    bool m_legacyTLSEnabled { false };
    184188    bool m_fastServerTrustEvaluationEnabled { false };
    185189    bool m_serviceWorkerProcessTerminationDelayEnabled { true };
  • trunk/Tools/ChangeLog

    r254342 r254344  
     12020-01-10  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
     4        https://bugs.webkit.org/show_bug.cgi?id=206046
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
     9        (TestWebKitAPI::TEST):
     10
    1112020-01-10  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm

    r253292 r254344  
    3434#import "WebCoreTestSupport.h"
    3535#import <WebKit/WKProcessPoolPrivate.h>
     36#import <WebKit/WKWebsiteDataStorePrivate.h>
    3637#import <WebKit/WebKit.h>
     38#import <WebKit/_WKWebsiteDataStoreConfiguration.h>
    3739#import <wtf/RetainPtr.h>
    3840
     
    196198        [delegate waitForDidFailProvisionalNavigation];
    197199    }
     200    {
     201        TCPServer server(TCPServer::Protocol::HTTPS, TCPServer::respondWithOK, tls1_1);
     202        auto configuration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration]);
     203        [configuration setLegacyTLSEnabled:YES];
     204        auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:configuration.get()]);
     205        auto webView = makeWebViewWith(dataStore.get());
     206        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/", server.port()]]]];
     207        [delegate waitForDidFinishNavigation];
     208    }
    198209    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:defaultsKey];
    199210    {
Note: See TracChangeset for help on using the changeset viewer.