Title: [235278] tags/Safari-607.1.3/Source/WebKit

Diff

Modified: tags/Safari-607.1.3/Source/WebKit/ChangeLog (235277 => 235278)


--- tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 07:27:46 UTC (rev 235277)
+++ tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 07:27:50 UTC (rev 235278)
@@ -1,5 +1,9 @@
 2018-08-23  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Revert r234990. rdar://problem/43667266
+
+2018-08-23  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Revert r235266. rdar://problem/43667266
 
 2018-08-23  Kocsen Chung  <kocsen_ch...@apple.com>

Modified: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp (235277 => 235278)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 07:27:46 UTC (rev 235277)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 07:27:50 UTC (rev 235278)
@@ -261,6 +261,12 @@
         completionHandler(AuthenticationChallengeDisposition::UseCredential, { });
         return;
     }
+
+#if PLATFORM(COCOA)
+    if (scheme == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
+        && NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge))
+        return completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(challenge));
+#endif
     
     if (auto* pendingDownload = m_task->pendingDownload())
         NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, challenge, WTFMove(completionHandler));

Modified: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.cpp (235277 => 235278)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.cpp	2018-08-24 07:27:46 UTC (rev 235277)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.cpp	2018-08-24 07:27:50 UTC (rev 235278)
@@ -79,4 +79,13 @@
         task->invalidateAndCancel();
 }
 
+bool NetworkSession::allowsSpecificHTTPSCertificateForHost(const WebCore::AuthenticationChallenge& challenge)
+{
+#if PLATFORM(COCOA)
+    return NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge);
+#else
+    return false;
+#endif
+}
+
 } // namespace WebKit

Modified: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.h (235277 => 235278)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.h	2018-08-24 07:27:46 UTC (rev 235277)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.h	2018-08-24 07:27:50 UTC (rev 235278)
@@ -54,6 +54,8 @@
     void registerNetworkDataTask(NetworkDataTask& task) { m_dataTaskSet.add(&task); }
     void unregisterNetworkDataTask(NetworkDataTask& task) { m_dataTaskSet.remove(&task); }
 
+    static bool allowsSpecificHTTPSCertificateForHost(const WebCore::AuthenticationChallenge&);
+
 protected:
     NetworkSession(PAL::SessionID);
 

Modified: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (235277 => 235278)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2018-08-24 07:27:46 UTC (rev 235277)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2018-08-24 07:27:50 UTC (rev 235278)
@@ -330,13 +330,13 @@
         return;
     }
 
-    if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+    // Handle server trust evaluation at platform-level if requested, for performance reasons.
+    if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust] && !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) {
         if (NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge))
-            return completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
-
-        // Handle server trust evaluation at platform-level if requested, for performance reasons and to use ATS defaults.
-        if (!NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation())
-            return completionHandler(NSURLSessionAuthChallengeRejectProtectionSpace, nil);
+            completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
+        else
+            completionHandler(NSURLSessionAuthChallengeRejectProtectionSpace, nil);
+        return;
     }
 
     if (auto* networkDataTask = [self existingTask:task]) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to