summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorhawk@chromium.org <hawk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 20:55:37 +0000
committerhawk@chromium.org <hawk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 20:55:37 +0000
commit9af506084e92488285a4f213d35784449979bb97 (patch)
treebed80525d62c45dd38db3b59847dd5e9861bb53c /chrome/browser/cocoa
parent2a34f5a924c6fea7f30a9a891bd90869eded13ef (diff)
downloadchromium_src-9af506084e92488285a4f213d35784449979bb97.zip
chromium_src-9af506084e92488285a4f213d35784449979bb97.tar.gz
chromium_src-9af506084e92488285a4f213d35784449979bb97.tar.bz2
View Certificate dialog sometimes shows incorrect status because it didn't have the full certificate chain.
BUG=23122 TEST=https://www.paypal.com should have "This certificate is valid" in View Page Info->View Certificate Information Review URL: http://codereview.chromium.org/256064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/page_info_window_mac.mm23
1 files changed, 18 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/page_info_window_mac.mm b/chrome/browser/cocoa/page_info_window_mac.mm
index b7dfff7..910ce3f 100644
--- a/chrome/browser/cocoa/page_info_window_mac.mm
+++ b/chrome/browser/cocoa/page_info_window_mac.mm
@@ -8,6 +8,7 @@
#include <SecurityInterface/SFCertificatePanel.h>
#include "app/l10n_util.h"
+#include "base/scoped_cftyperef.h"
#include "base/i18n/time_formatting.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
@@ -67,16 +68,28 @@ void PageInfoWindowMac::ShowCertDialog(int) {
if (!cert_mac)
return;
+ scoped_cftyperef<CFMutableArrayRef> certificates(
+ CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
+ if (!certificates.get()) {
+ NOTREACHED();
+ return;
+ }
+ CFArrayAppendValue(certificates, cert_mac);
+
+ CFArrayRef ca_certs = cert->GetIntermediateCertificates();
+ if (ca_certs) {
+ // Server certificate must be first in the array; subsequent certificates
+ // in the chain can be in any order.
+ CFArrayAppendArray(certificates, ca_certs,
+ CFRangeMake(0, CFArrayGetCount(ca_certs)));
+ }
+
[[SFCertificatePanel sharedCertificatePanel]
beginSheetForWindow:[controller_ window]
modalDelegate:nil
didEndSelector:NULL
contextInfo:NULL
- // This is cast to id because we get compiler errors about an
- // OpaqueSecCertificateRef* being converted to an ObjC class.
- // It's a CF-type so it's toll-free bridged and casting to id
- // is OK.
- certificates:[NSArray arrayWithObject:(id)cert_mac]
+ certificates:reinterpret_cast<NSArray*>(certificates.get())
showGroup:YES
];
}