Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: chrome/browser/ui/certificate_viewer_mac.mm

Issue 2746103003: Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/certificate_viewer_mac.h" 5 #import "chrome/browser/ui/certificate_viewer_mac.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 @implementation SSLCertificateViewerMac { 92 @implementation SSLCertificateViewerMac {
93 // The corresponding list of certificates. 93 // The corresponding list of certificates.
94 base::scoped_nsobject<NSArray> certificates_; 94 base::scoped_nsobject<NSArray> certificates_;
95 base::scoped_nsobject<SFCertificatePanel> panel_; 95 base::scoped_nsobject<SFCertificatePanel> panel_;
96 } 96 }
97 97
98 - (instancetype)initWithCertificate:(net::X509Certificate*)certificate 98 - (instancetype)initWithCertificate:(net::X509Certificate*)certificate
99 forWebContents:(content::WebContents*)webContents { 99 forWebContents:(content::WebContents*)webContents {
100 if ((self = [super init])) { 100 if ((self = [super init])) {
101 base::ScopedCFTypeRef<CFArrayRef> certChain( 101 base::ScopedCFTypeRef<CFArrayRef> certChain(
102 certificate->CreateOSCertChainForCert()); 102 net::x509_util::CreateSecCertificateArrayForX509Certificate(
103 certificate));
104 if (!certChain)
105 return self;
103 NSArray* certificates = base::mac::CFToNSCast(certChain.get()); 106 NSArray* certificates = base::mac::CFToNSCast(certChain.get());
104 certificates_.reset([certificates retain]); 107 certificates_.reset([certificates retain]);
105 } 108 }
106 109
107 // Explicitly disable revocation checking, regardless of user preferences 110 // Explicitly disable revocation checking, regardless of user preferences
108 // or system settings. The behaviour of SFCertificatePanel is to call 111 // or system settings. The behaviour of SFCertificatePanel is to call
109 // SecTrustEvaluate on the certificate(s) supplied, effectively 112 // SecTrustEvaluate on the certificate(s) supplied, effectively
110 // duplicating the behaviour of net::X509Certificate::Verify(). However, 113 // duplicating the behaviour of net::X509Certificate::Verify(). However,
111 // this call stalls the UI if revocation checking is enabled in the 114 // this call stalls the UI if revocation checking is enabled in the
112 // Keychain preferences or if the cert may be an EV cert. By disabling 115 // Keychain preferences or if the cert may be an EV cert. By disabling
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 175
173 - (void)releaseSheetWindow { 176 - (void)releaseSheetWindow {
174 panel_.reset(); 177 panel_.reset();
175 } 178 }
176 179
177 - (NSWindow*)certificatePanel { 180 - (NSWindow*)certificatePanel {
178 return panel_; 181 return panel_;
179 } 182 }
180 183
181 @end 184 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698