Title: [160122] trunk/Source/WebKit2
Revision
160122
Author
[email protected]
Date
2013-12-04 14:00:35 -0800 (Wed, 04 Dec 2013)

Log Message

[Mac] When NSError user info is missing NSErrorPeerCertificateChainKey, ArgumentCoder should extract it from NSURLErrorFailingURLPeerTrustErrorKey
https://bugs.webkit.org/show_bug.cgi?id=125251

Reviewed by Anders Carlsson.

* Shared/mac/WebCoreArgumentCodersMac.mm:
(CoreIPC::::encodePlatformData): If the user info doesn’t include
NSURLErrorFailingURLPeerTrustErrorKey, copy the peer certificate chain from the peer trust
under NSURLErrorFailingURLPeerTrustErrorKey. On the decoding side, it will appear under the
NSURLErrorFailingURLPeerTrustErrorKey, because a trust object can’t be fully serialized.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (160121 => 160122)


--- trunk/Source/WebKit2/ChangeLog	2013-12-04 21:35:38 UTC (rev 160121)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-04 22:00:35 UTC (rev 160122)
@@ -1,5 +1,18 @@
 2013-12-04  Dan Bernstein  <[email protected]>
 
+        [Mac] When NSError user info is missing NSErrorPeerCertificateChainKey, ArgumentCoder should extract it from NSURLErrorFailingURLPeerTrustErrorKey
+        https://bugs.webkit.org/show_bug.cgi?id=125251
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (CoreIPC::::encodePlatformData): If the user info doesn’t include
+        NSURLErrorFailingURLPeerTrustErrorKey, copy the peer certificate chain from the peer trust
+        under NSURLErrorFailingURLPeerTrustErrorKey. On the decoding side, it will appear under the
+        NSURLErrorFailingURLPeerTrustErrorKey, because a trust object can’t be fully serialized.
+
+2013-12-04  Dan Bernstein  <[email protected]>
+
         Replace USE(SECURITY_FRAMEWORK) with finer-grained defines
         https://bugs.webkit.org/show_bug.cgi?id=125242
 

Modified: trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm (160121 => 160122)


--- trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm	2013-12-04 21:35:38 UTC (rev 160121)
+++ trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm	2013-12-04 22:00:35 UTC (rev 160122)
@@ -167,6 +167,14 @@
     CoreIPC::encode(encoder, filteredUserInfo.get());
 
     id peerCertificateChain = [userInfo objectForKey:@"NSErrorPeerCertificateChainKey"];
+    if (!peerCertificateChain) {
+        if (SecTrustRef peerTrust = (SecTrustRef)userInfo[NSURLErrorFailingURLPeerTrustErrorKey]) {
+            CFIndex count = SecTrustGetCertificateCount(peerTrust);
+            peerCertificateChain = [NSMutableArray arrayWithCapacity:count];
+            for (CFIndex i = 0; i < count; ++i)
+                [peerCertificateChain addObject:(id)SecTrustGetCertificateAtIndex(peerTrust, i)];
+        }
+    }
     ASSERT(!peerCertificateChain || [peerCertificateChain isKindOfClass:[NSArray class]]);
     encoder << CertificateInfo((CFArrayRef)peerCertificateChain);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to