⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238747 in webkit


Ignore:
Timestamp:
Nov 30, 2018, 11:58:07 AM (8 years ago)
Author:
ap@apple.com
Message:

Move USE_CFNETWORK_IGNORE_HSTS to its proper place
​https://bugs.webkit.org/show_bug.cgi?id=192173

Reviewed by Tim Horton.

Source/WebCore:

  • platform/network/mac/WebCoreURLResponse.mm:

(WebCore::schemeWasUpgradedDueToDynamicHSTS):

Source/WebCore/PAL:

  • pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(updateIgnoreStrictTransportSecuritySettingIfNecessary):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):

Source/WTF:

  • wtf/Platform.h: Also renamed it to better match other version checks.
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r238685 r238747  
     12018-11-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Move USE_CFNETWORK_IGNORE_HSTS to its proper place
     4        https://bugs.webkit.org/show_bug.cgi?id=192173
     5
     6        Reviewed by Tim Horton.
     7
     8        * wtf/Platform.h: Also renamed it to better match other version checks.
     9
    1102018-11-29  Alexey Proskuryakov  <ap@apple.com>
    211
  • trunk/Source/WTF/wtf/Platform.h

    r238685 r238747  
    14071407#endif
    14081408#endif
     1409
     1410#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS_FAMILY)
     1411#define HAVE_CFNETWORK_WITH_IGNORE_HSTS 1
     1412#endif
  • trunk/Source/WebCore/ChangeLog

    r238744 r238747  
     12018-11-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Move USE_CFNETWORK_IGNORE_HSTS to its proper place
     4        https://bugs.webkit.org/show_bug.cgi?id=192173
     5
     6        Reviewed by Tim Horton.
     7
     8        * platform/network/mac/WebCoreURLResponse.mm:
     9        (WebCore::schemeWasUpgradedDueToDynamicHSTS):
     10
    1112018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
    212
  • trunk/Source/WebCore/PAL/ChangeLog

    r238710 r238747  
     12018-11-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Move USE_CFNETWORK_IGNORE_HSTS to its proper place
     4        https://bugs.webkit.org/show_bug.cgi?id=192173
     5
     6        Reviewed by Tim Horton.
     7
     8        * pal/spi/cf/CFNetworkSPI.h:
     9
    1102018-11-29  David Quesada  <david_quesada@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h

    r238685 r238747  
    3030#include <CFNetwork/CFNetwork.h>
    3131#include <pal/spi/cf/CFNetworkConnectionCacheSPI.h>
    32 
    33 // FIXME: Policy about which CFNetwork features to *use* in WebKit does not belong in the SPI header.
    34 // The SPI header should define which CFNetwork features *exist* in the underlying system, but not
    35 // policy about what WebKit should do. Accordingly, we should move this somewhere else or rename it
    36 // to be about CFNetwork capabilities (HAVE) rather than about WebKit policy (USE).
    37 #if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000) || (PLATFORM(TVOS) && __TV_OS_VERSION_MIN_REQUIRED >= 120000))
    38 #define USE_CFNETWORK_IGNORE_HSTS 1
    39 #endif
    4032
    4133#if PLATFORM(WIN) || USE(APPLE_INTERNAL_SDK)
  • trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm

    r238673 r238747  
    332332static bool schemeWasUpgradedDueToDynamicHSTS(NSURLRequest *request)
    333333{
    334 #if !USE(CFNETWORK_IGNORE_HSTS)
     334#if HAVE(CFNETWORK_WITH_IGNORE_HSTS)
     335    return [request _schemeWasUpgradedDueToDynamicHSTS];
     336#else
    335337    UNUSED_PARAM(request);
    336338    return false;
    337 #else
    338     return [request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)]
    339         && [request _schemeWasUpgradedDueToDynamicHSTS];
    340339#endif
    341340}
  • trunk/Source/WebKit/ChangeLog

    r238746 r238747  
     12018-11-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Move USE_CFNETWORK_IGNORE_HSTS to its proper place
     4        https://bugs.webkit.org/show_bug.cgi?id=192173
     5
     6        Reviewed by Tim Horton.
     7
     8        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     9        (updateIgnoreStrictTransportSecuritySettingIfNecessary):
     10        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
     11        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
     12
    1132018-11-30  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r238702 r238747  
    163163}
    164164
    165 #if USE(CFNETWORK_IGNORE_HSTS)
     165#if HAVE(CFNETWORK_WITH_IGNORE_HSTS)
    166166static NSURLRequest* downgradeRequest(NSURLRequest *request)
    167167{
    … …  
    200200static NSURLRequest* updateIgnoreStrictTransportSecuritySettingIfNecessary(NSURLRequest *request, bool shouldIgnoreHSTS)
    201201{
    202 #if USE(CFNETWORK_IGNORE_HSTS)
     202#if HAVE(CFNETWORK_WITH_IGNORE_HSTS)
    203203    if ([request.URL.scheme isEqualToString:@"https"] && shouldIgnoreHSTS && ignoreHSTS(request)) {
    204204        // The request was upgraded for some other reason than HSTS.
    … …  
    230230
    231231        bool shouldIgnoreHSTS = false;
    232 #if USE(CFNETWORK_IGNORE_HSTS)
     232#if HAVE(CFNETWORK_WITH_IGNORE_HSTS)
    233233        shouldIgnoreHSTS = schemeWasUpgradedDueToDynamicHSTS(request) && WebCore::NetworkStorageSession::storageSession(_session->sessionID())->shouldBlockCookies(request, networkDataTask->frameID(), networkDataTask->pageID());
    234234        if (shouldIgnoreHSTS) {
    … …  
    263263    if (auto* networkDataTask = [self existingTask:task]) {
    264264        bool shouldIgnoreHSTS = false;
    265 #if USE(CFNETWORK_IGNORE_HSTS)
     265#if HAVE(CFNETWORK_WITH_IGNORE_HSTS)
    266266        shouldIgnoreHSTS = schemeWasUpgradedDueToDynamicHSTS(request) && WebCore::NetworkStorageSession::storageSession(_session->sessionID())->shouldBlockCookies(request, networkDataTask->frameID(), networkDataTask->pageID());
    267267        if (shouldIgnoreHSTS) {
Note: See TracChangeset for help on using the changeset viewer.