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

Side by Side Diff: net/cert/x509_certificate_openssl.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, 3 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_nss.cc ('k') | net/cert/x509_certificate_win.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 <openssl/asn1.h> 7 #include <openssl/asn1.h>
8 #include <openssl/bytestring.h> 8 #include <openssl/bytestring.h>
9 #include <openssl/crypto.h> 9 #include <openssl/crypto.h>
10 #include <openssl/obj_mac.h> 10 #include <openssl/obj_mac.h>
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 // static 303 // static
304 X509_STORE* X509Certificate::cert_store() { 304 X509_STORE* X509Certificate::cert_store() {
305 return X509InitSingleton::GetInstance()->store(); 305 return X509InitSingleton::GetInstance()->store();
306 } 306 }
307 307
308 // static 308 // static
309 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle, 309 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle,
310 std::string* encoded) { 310 std::string* encoded) {
311 base::StringPiece der; 311 base::StringPiece der;
312 if (!x509_util::GetDER(cert_handle, &der)) 312 if (!cert_handle || !x509_util::GetDER(cert_handle, &der))
313 return false; 313 return false;
314 encoded->assign(der.data(), der.length()); 314 encoded->assign(der.data(), der.length());
315 return true; 315 return true;
316 } 316 }
317 317
318 // static 318 // static
319 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, 319 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
320 X509Certificate::OSCertHandle b) { 320 X509Certificate::OSCertHandle b) {
321 DCHECK(a && b); 321 DCHECK(a && b);
322 if (a == b) 322 if (a == b)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (X509_NAME_cmp(issuer, cert_names[n]) == 0) { 433 if (X509_NAME_cmp(issuer, cert_names[n]) == 0) {
434 return true; 434 return true;
435 } 435 }
436 } 436 }
437 } 437 }
438 438
439 return false; 439 return false;
440 } 440 }
441 441
442 } // namespace net 442 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_certificate_nss.cc ('k') | net/cert/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698