Title: [224665] trunk/Source
Revision
224665
Author
cdu...@apple.com
Date
2017-11-09 23:03:24 -0800 (Thu, 09 Nov 2017)

Log Message

Unreviewed, rolling out r224661.

Broke build on several internal Mac/iOS bots

Reverted changeset:

"Ignore HSTS for partitioned, cross-origin subresource
requests"
https://bugs.webkit.org/show_bug.cgi?id=178993
https://trac.webkit.org/changeset/224661

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (224664 => 224665)


--- trunk/Source/WTF/ChangeLog	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WTF/ChangeLog	2017-11-10 07:03:24 UTC (rev 224665)
@@ -1,3 +1,16 @@
+2017-11-09  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, rolling out r224661.
+
+        Broke build on several internal Mac/iOS bots
+
+        Reverted changeset:
+
+        "Ignore HSTS for partitioned, cross-origin subresource
+        requests"
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        https://trac.webkit.org/changeset/224661
+
 2017-11-09  John Wilander  <wilan...@apple.com>
 
         Ignore HSTS for partitioned, cross-origin subresource requests

Modified: trunk/Source/WTF/wtf/Platform.h (224664 => 224665)


--- trunk/Source/WTF/wtf/Platform.h	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WTF/wtf/Platform.h	2017-11-10 07:03:24 UTC (rev 224665)
@@ -677,16 +677,6 @@
 #define HAVE_CFNETWORK_STORAGE_PARTITIONING 1
 #endif
 
-#if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110200) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40200) || (PLATFORM(TVOS) && __TV_OS_VERSION_MIN_REQUIRED >= 110200))
-#define HAVE_CFNETWORK_IGNORE_HSTS 1
-
-/* FIXME: Remove after rdar 35390452 is fixed: */
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
-#define HAVE_CFNETWORK_IGNORE_HSTS 0
-#endif
-
-#endif
-
 #if OS(DARWIN) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
 #define HAVE_MACHINE_CONTEXT 1
 #endif

Modified: trunk/Source/WebCore/ChangeLog (224664 => 224665)


--- trunk/Source/WebCore/ChangeLog	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebCore/ChangeLog	2017-11-10 07:03:24 UTC (rev 224665)
@@ -1,5 +1,18 @@
 2017-11-09  Chris Dumez  <cdu...@apple.com>
 
+        Unreviewed, rolling out r224661.
+
+        Broke build on several internal Mac/iOS bots
+
+        Reverted changeset:
+
+        "Ignore HSTS for partitioned, cross-origin subresource
+        requests"
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        https://trac.webkit.org/changeset/224661
+
+2017-11-09  Chris Dumez  <cdu...@apple.com>
+
         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
         https://bugs.webkit.org/show_bug.cgi?id=179517
 

Modified: trunk/Source/WebCore/PAL/ChangeLog (224664 => 224665)


--- trunk/Source/WebCore/PAL/ChangeLog	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebCore/PAL/ChangeLog	2017-11-10 07:03:24 UTC (rev 224665)
@@ -1,3 +1,16 @@
+2017-11-09  Chris Dumez  <cdu...@apple.com>
+
+        Unreviewed, rolling out r224661.
+
+        Broke build on several internal Mac/iOS bots
+
+        Reverted changeset:
+
+        "Ignore HSTS for partitioned, cross-origin subresource
+        requests"
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        https://trac.webkit.org/changeset/224661
+
 2017-11-09  John Wilander  <wilan...@apple.com>
 
         Ignore HSTS for partitioned, cross-origin subresource requests

Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (224664 => 224665)


--- trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h	2017-11-10 07:03:24 UTC (rev 224665)
@@ -97,20 +97,11 @@
 - (id)_initWithCFURLRequest:(CFURLRequestRef)request;
 - (id)_propertyForKey:(NSString *)key;
 - (void)_setProperty:(id)value forKey:(NSString *)key;
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-- (BOOL)_schemeWasUpgradedDueToDynamicHSTS;
-- (BOOL)_preventHSTSStorage;
-- (BOOL)_ignoreHSTS;
-#endif
 @end
 
 @interface NSMutableURLRequest ()
 - (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray;
 - (void)setBoundInterfaceIdentifier:(NSString *)identifier;
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-- (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage;
-- (void)_setIgnoreHSTS:(BOOL)ignoreHSTS;
-#endif
 @end
 
 @interface NSURLResponse ()

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm (224664 => 224665)


--- trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2017-11-10 07:03:24 UTC (rev 224665)
@@ -31,7 +31,6 @@
 
 #import "MIMETypeRegistry.h"
 #import "UTIUtilities.h"
-#import <pal/spi/cf/CFNetworkSPI.h>
 #import <wtf/Assertions.h>
 #import <wtf/RetainPtr.h>
 
@@ -333,13 +332,8 @@
     if (redirectResponse)
         return redirectResponse;
 
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-    if ([[[newRequest URL] scheme] isEqualToString:[[currentRequest URL] scheme]] && ![newRequest _schemeWasUpgradedDueToDynamicHSTS])
-        return nil;
-#else
     if ([[[newRequest URL] scheme] isEqualToString:[[currentRequest URL] scheme]])
         return nil;
-#endif
 
     // If the new request is a different protocol than the current request, synthesize a redirect response.
     // This is critical for HSTS (<rdar://problem/14241270>).

Modified: trunk/Source/WebKit/ChangeLog (224664 => 224665)


--- trunk/Source/WebKit/ChangeLog	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebKit/ChangeLog	2017-11-10 07:03:24 UTC (rev 224665)
@@ -1,5 +1,18 @@
 2017-11-09  Chris Dumez  <cdu...@apple.com>
 
+        Unreviewed, rolling out r224661.
+
+        Broke build on several internal Mac/iOS bots
+
+        Reverted changeset:
+
+        "Ignore HSTS for partitioned, cross-origin subresource
+        requests"
+        https://bugs.webkit.org/show_bug.cgi?id=178993
+        https://trac.webkit.org/changeset/224661
+
+2017-11-09  Chris Dumez  <cdu...@apple.com>
+
         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
         https://bugs.webkit.org/show_bug.cgi?id=179517
 

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (224664 => 224665)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2017-11-10 06:26:40 UTC (rev 224664)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2017-11-10 07:03:24 UTC (rev 224665)
@@ -165,42 +165,6 @@
     completionHandler(WebCore::createHTTPBodyNSInputStream(*body).get());
 }
 
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-static NSURLRequest* downgradeRequest(NSURLRequest *request)
-{
-    NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
-    if ([nsMutableRequest.URL.scheme isEqualToString:@"https"]) {
-        NSURLComponents *components = [[NSURLComponents componentsWithURL:nsMutableRequest.URL resolvingAgainstBaseURL:NO] autorelease];
-        components.scheme = @"http";
-        [nsMutableRequest setURL:components.URL];
-        ASSERT([nsMutableRequest.URL.scheme isEqualToString:@"http"]);
-        return nsMutableRequest;
-    }
-
-    ASSERT_NOT_REACHED();
-    return request;
-}
-
-static NSURLRequest* updateIgnoreStrictTransportSecuritySettingIfNecessary(NSURLRequest *request, bool shouldIgnoreHSTS)
-{
-    if ([request.URL.scheme isEqualToString:@"https"] && shouldIgnoreHSTS && [request _ignoreHSTS]) {
-        // The request was upgraded for some other reason than HSTS.
-        // Don't ignore HSTS to avoid the risk of another downgrade.
-        NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
-        [nsMutableRequest _setIgnoreHSTS:NO];
-        return nsMutableRequest;
-    }
-    
-    if ([request.URL.scheme isEqualToString:@"http"] && [request _ignoreHSTS] != shouldIgnoreHSTS) {
-        NSMutableURLRequest *nsMutableRequest = [[request mutableCopy] autorelease];
-        [nsMutableRequest _setIgnoreHSTS:shouldIgnoreHSTS];
-        return nsMutableRequest;
-    }
-    
-    return request;
-}
-#endif
-
 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler
 {
     auto taskIdentifier = task.taskIdentifier;
@@ -208,30 +172,13 @@
 
     if (auto* networkDataTask = [self existingTask:task]) {
         auto completionHandlerCopy = Block_copy(completionHandler);
-
-        bool shouldIgnoreHSTS = false;
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-        shouldIgnoreHSTS = [request _schemeWasUpgradedDueToDynamicHSTS] && !(WebCore::NetworkStorageSession::storageSession(_session->sessionID())->cookieStoragePartition(request)).isEmpty();
-        if (shouldIgnoreHSTS) {
-            request = downgradeRequest(request);
-            ASSERT([request.URL.scheme isEqualToString:@"http"]);
-            LOG(NetworkSession, "%llu Downgraded %s from https to http", taskIdentifier, request.URL.absoluteString.UTF8String);
-        }
-#endif
-
-        networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier, shouldIgnoreHSTS](auto&& request) {
+        networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier](auto&& request) {
 #if !LOG_DISABLED
             LOG(NetworkSession, "%llu willPerformHTTPRedirection completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
 #else
             UNUSED_PARAM(taskIdentifier);
 #endif
-            auto nsRequest = request.nsURLRequest(WebCore::UpdateHTTPBody);
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-            nsRequest = updateIgnoreStrictTransportSecuritySettingIfNecessary(nsRequest, shouldIgnoreHSTS);
-#else
-            UNUSED_PARAM(shouldIgnoreHSTS);
-#endif
-            completionHandlerCopy(nsRequest);
+            completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
             Block_release(completionHandlerCopy);
         });
     } else {
@@ -244,32 +191,16 @@
 {
     auto taskIdentifier = task.taskIdentifier;
     LOG(NetworkSession, "%llu _schemeUpgraded %s", taskIdentifier, request.URL.absoluteString.UTF8String);
-
-    bool shouldIgnoreHSTS = false;
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-    shouldIgnoreHSTS = [request _schemeWasUpgradedDueToDynamicHSTS] && !(WebCore::NetworkStorageSession::storageSession(_session->sessionID())->cookieStoragePartition(request)).isEmpty();
-    if (shouldIgnoreHSTS) {
-        request = downgradeRequest(request);
-        ASSERT([request.URL.scheme isEqualToString:@"http"]);
-        LOG(NetworkSession, "%llu Downgraded %s from https to http", taskIdentifier, request.URL.absoluteString.UTF8String);
-    }
-#endif
-
+    
     if (auto* networkDataTask = [self existingTask:task]) {
         auto completionHandlerCopy = Block_copy(completionHandler);
-        networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier, shouldIgnoreHSTS](auto&& request) {
+        networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier](auto&& request) {
 #if !LOG_DISABLED
             LOG(NetworkSession, "%llu _schemeUpgraded completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
 #else
             UNUSED_PARAM(taskIdentifier);
 #endif
-            auto nsRequest = request.nsURLRequest(WebCore::UpdateHTTPBody);
-#if HAVE(CFNETWORK_IGNORE_HSTS)
-            nsRequest = updateIgnoreStrictTransportSecuritySettingIfNecessary(nsRequest, shouldIgnoreHSTS);
-#else
-            UNUSED_PARAM(shouldIgnoreHSTS);
-#endif
-            completionHandlerCopy(nsRequest);
+            completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
             Block_release(completionHandlerCopy);
         });
     } else {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to