Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Nov 2019 22:41:50 +0000 (22:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Nov 2019 22:41:50 +0000 (22:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204159
Source/WebCore:

<rdar://problem/45894288>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-11-18
Reviewed by Darin Adler.

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):

Source/WebKit:

Patch by Alex Christensen <achristensen@webkit.org> on 2019-11-18
Reviewed by Darin Adler.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]):

Source/WTF:

<rdar://problem/45894288>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-11-18
Reviewed by Darin Adler.

* wtf/Platform.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@252595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm

index 6aaa439..5128207 100644 (file)
@@ -1,3 +1,13 @@
+2019-11-18  Alex Christensen  <achristensen@webkit.org>
+
+        Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
+        https://bugs.webkit.org/show_bug.cgi?id=204159
+        <rdar://problem/45894288>
+
+        Reviewed by Darin Adler.
+
+        * wtf/Platform.h:
+
 2019-11-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Remove index-masking on ScopedArguments and put it in IsoSubspace
index 215806d..b0966df 100644 (file)
 #define HAVE_TLS_PROTOCOL_VERSION_T 1
 #endif
 
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS) || PLATFORM(APPLETV) || PLATFORM(MACCATALYST)
+#define HAVE_SEC_TRUST_EVALUATE_WITH_ERROR 1
+#endif
+
 #if PLATFORM(IOS) || PLATFORM(MACCATALYST)
 #define USE_UICONTEXTMENU 1
 #endif
index 4aa920f..0474e07 100644 (file)
@@ -1,3 +1,14 @@
+2019-11-18  Alex Christensen  <achristensen@webkit.org>
+
+        Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
+        https://bugs.webkit.org/show_bug.cgi?id=204159
+        <rdar://problem/45894288>
+
+        Reviewed by Darin Adler.
+
+        * platform/network/cocoa/ResourceResponseCocoa.mm:
+        (WebCore::ResourceResponse::platformCertificateInfo const):
+
 2019-11-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         Fix getTotalLength() and getPointAtLength() for optimized rect and ellipse renderers
index 5ef9ab9..85aa1e1 100644 (file)
@@ -96,12 +96,14 @@ CertificateInfo ResourceResponse::platformCertificateInfo() const
         return { };
 
     if (trustResultType == kSecTrustResultInvalid) {
-        // FIXME: This is deprecated <rdar://problem/45894288>.
-        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
+#if HAVE(SEC_TRUST_EVALUATE_WITH_ERROR)
+        if (!SecTrustEvaluateWithError(trust, nullptr))
+            return { };
+#else
         result = SecTrustEvaluate(trust, &trustResultType);
-        ALLOW_DEPRECATED_DECLARATIONS_END
         if (result != errSecSuccess)
             return { };
+#endif
     }
 
 #if HAVE(SEC_TRUST_SERIALIZATION)
index 44ec576..e4d8e4a 100644 (file)
@@ -1,3 +1,13 @@
+2019-11-18  Alex Christensen  <achristensen@webkit.org>
+
+        Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
+        https://bugs.webkit.org/show_bug.cgi?id=204159
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+        (-[WKFullScreenWindowController _EVOrganizationName]):
+
 2019-11-18  Darin Adler  <darin@apple.com>
 
         WKWebView.mediaType is nullable, not null_resettable
index 99eb1d5..1a2bfd8 100644 (file)
@@ -929,19 +929,20 @@ static RetainPtr<UIWindow> makeWindowFromView(UIView *)
     if (!trust)
         return nil;
 
-    NSDictionary *infoDictionary = [(__bridge NSDictionary *)SecTrustCopyInfo(trust) autorelease];
+    NSDictionary *infoDictionary = CFBridgingRelease(SecTrustCopyInfo(trust));
     // If SecTrustCopyInfo returned NULL then it's likely that the SecTrustRef has not been evaluated
     // and the only way to get the information we need is to call SecTrustEvaluate ourselves.
     if (!infoDictionary) {
+#if HAVE(SEC_TRUST_EVALUATE_WITH_ERROR)
+        if (!SecTrustEvaluateWithError(trust, nullptr))
+            return nil;
+#else
         SecTrustResultType result = kSecTrustResultProceed;
-
-        // FIXME: This is deprecated <rdar://problem/45894288>.
-        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         OSStatus err = SecTrustEvaluate(trust, &result);
-        ALLOW_DEPRECATED_DECLARATIONS_END
-
-        if (err == noErr)
-            infoDictionary = [(__bridge NSDictionary *)SecTrustCopyInfo(trust) autorelease];
+        if (err != noErr)
+            return nil;
+#endif
+        infoDictionary = CFBridgingRelease(SecTrustCopyInfo(trust));
         if (!infoDictionary)
             return nil;
     }