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

Diff

Modified: tags/Safari-607.1.3/Source/WebKit/ChangeLog (235269 => 235270)


--- tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 03:41:48 UTC (rev 235269)
+++ tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 04:08:48 UTC (rev 235270)
@@ -1,5 +1,9 @@
 2018-08-23  Kocsen Chung  <[email protected]>
 
+        Revert r234990. rdar://problem/43667266
+
+2018-08-23  Kocsen Chung  <[email protected]>
+
         Revert r234941. rdar://problem/43667266
 
 2018-08-23  Kocsen Chung  <[email protected]>

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


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 03:41:48 UTC (rev 235269)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 04:08:48 UTC (rev 235270)
@@ -278,6 +278,13 @@
 
     if (!m_task)
         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, *m_challenge, WTFMove(completionHandler));
     else

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


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.cpp	2018-08-24 03:41:48 UTC (rev 235269)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.cpp	2018-08-24 04:08:48 UTC (rev 235270)
@@ -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 (235269 => 235270)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.h	2018-08-24 03:41:48 UTC (rev 235269)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkSession.h	2018-08-24 04:08:48 UTC (rev 235270)
@@ -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 (235269 => 235270)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2018-08-24 03:41:48 UTC (rev 235269)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2018-08-24 04:08:48 UTC (rev 235270)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to