| OLD | NEW |
| 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 <blapi.h> // Implement CalculateChainFingerprint() with NSS. | 7 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 it != intermediate_ca_certs_.end(); ++it) { | 446 it != intermediate_ca_certs_.end(); ++it) { |
| 447 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, | 447 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, |
| 448 valid_issuers)) { | 448 valid_issuers)) { |
| 449 return true; | 449 return true; |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 return false; | 453 return false; |
| 454 } | 454 } |
| 455 | 455 |
| 456 // static |
| 457 bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) { |
| 458 return CryptVerifyCertificateSignatureEx( |
| 459 NULL, |
| 460 X509_ASN_ENCODING, |
| 461 CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT, |
| 462 cert_handle, |
| 463 CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT, |
| 464 cert_handle, |
| 465 0, |
| 466 NULL); |
| 467 } |
| 468 |
| 456 } // namespace net | 469 } // namespace net |
| OLD | NEW |