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

Side by Side Diff: net/cert/x509_certificate_mac.cc

Issue 584463005: Add debugging information to the SSL blocking page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Brackets for multi-line if Created 6 years, 2 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 | « net/cert/x509_certificate_ios.cc ('k') | net/cert/x509_certificate_nss.cc » ('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 #include "net/cert/x509_certificate.h" 5 #include "net/cert/x509_certificate.h"
6 6
7 #include <CommonCrypto/CommonDigest.h> 7 #include <CommonCrypto/CommonDigest.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 10
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 reinterpret_cast<const char*>(name_data.Data), 267 reinterpret_cast<const char*>(name_data.Data),
268 name_data.Length)); 268 name_data.Length));
269 } 269 }
270 } 270 }
271 } 271 }
272 272
273 // static 273 // static
274 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle, 274 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle,
275 std::string* encoded) { 275 std::string* encoded) {
276 CSSM_DATA der_data; 276 CSSM_DATA der_data;
277 if (SecCertificateGetData(cert_handle, &der_data) != noErr) 277 if (!cert_handle || SecCertificateGetData(cert_handle, &der_data) != noErr)
278 return false; 278 return false;
279 encoded->assign(reinterpret_cast<char*>(der_data.Data), 279 encoded->assign(reinterpret_cast<char*>(der_data.Data),
280 der_data.Length); 280 der_data.Length);
281 return true; 281 return true;
282 } 282 }
283 283
284 // static 284 // static
285 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, 285 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
286 X509Certificate::OSCertHandle b) { 286 X509Certificate::OSCertHandle b) {
287 DCHECK(a && b); 287 DCHECK(a && b);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 *type = kPublicKeyTypeDH; 507 *type = kPublicKeyTypeDH;
508 break; 508 break;
509 default: 509 default:
510 *type = kPublicKeyTypeUnknown; 510 *type = kPublicKeyTypeUnknown;
511 *size_bits = 0; 511 *size_bits = 0;
512 break; 512 break;
513 } 513 }
514 } 514 }
515 515
516 } // namespace net 516 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_ios.cc ('k') | net/cert/x509_certificate_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698