Bug 204159 - Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
Summary: Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-13 08:33 PST by Alex Christensen
Modified: 2019-11-18 14:41 PST (History)
8 users (show)

See Also:


Attachments
Patch (4.89 KB, patch)
2019-11-13 08:34 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.90 KB, patch)
2019-11-14 20:54 PST, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2019-11-13 08:33:32 PST
Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
Comment 1 Alex Christensen 2019-11-13 08:34:24 PST
Created attachment 383459 [details]
Patch
Comment 2 Alex Christensen 2019-11-13 08:34:27 PST
<rdar://problem/45894288>
Comment 3 Darin Adler 2019-11-13 09:13:32 PST
Comment on attachment 383459 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=383459&action=review

> Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm:101
> +        bool success = SecTrustEvaluateWithError(trust, &error);

This will leak the CFErrorRef. Note that the error argument is marked CF_RETURNS_RETAINED that indicates it’s the caller’s responsibility to release.

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:938
> +        bool success = SecTrustEvaluateWithError(trust, &error);

Ditto.

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:947
> +        infoDictionary = [(__bridge NSDictionary *)SecTrustCopyInfo(trust) autorelease];

Not important, but a side note. This line is just re-indented and this is not new code, but I would write this instead:

    infoDictionary = CFBridgingRelease(SecTrustCopyInfo(trust));
Comment 4 Alex Christensen 2019-11-14 20:54:55 PST
Created attachment 383599 [details]
Patch
Comment 5 Alex Christensen 2019-11-14 21:09:44 PST
Turns out having an error and returning false are the same, and we do nothing with the error, so I'm just passing nullptr to not receive the error.
Comment 6 WebKit Commit Bot 2019-11-18 14:41:57 PST
Comment on attachment 383599 [details]
Patch

Clearing flags on attachment: 383599

Committed r252595: <https://trac.webkit.org/changeset/252595>
Comment 7 WebKit Commit Bot 2019-11-18 14:41:59 PST
All reviewed patches have been landed.  Closing bug.