| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/free_deleter.h" | 8 #include "base/memory/free_deleter.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| 11 #include "base/pickle.h" | 11 #include "base/pickle.h" |
| 12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "crypto/capi_util.h" | 15 #include "crypto/capi_util.h" |
| 16 #include "crypto/scoped_capi_types.h" | 16 #include "crypto/scoped_capi_types.h" |
| 17 #include "crypto/sha2.h" | 17 #include "crypto/sha2.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 | 19 |
| 20 // Implement CalculateChainFingerprint() with our native crypto library. | 20 // Implement CalculateChainFingerprint() with our native crypto library. |
| 21 #if defined(USE_OPENSSL) | 21 #if defined(USE_OPENSSL) |
| 22 #include <openssl/sha.h> | 22 #include <openssl/sha.h> |
| 23 #else | 23 #else |
| 24 #include <blapi.h> | 24 #include <blapi.h> |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #pragma comment(lib, "crypt32.lib") | |
| 28 | |
| 29 using base::Time; | 27 using base::Time; |
| 30 | 28 |
| 31 namespace net { | 29 namespace net { |
| 32 | 30 |
| 33 namespace { | 31 namespace { |
| 34 | 32 |
| 35 typedef crypto::ScopedCAPIHandle< | 33 typedef crypto::ScopedCAPIHandle< |
| 36 HCERTSTORE, | 34 HCERTSTORE, |
| 37 crypto::CAPIDestroyerWithFlags<HCERTSTORE, | 35 crypto::CAPIDestroyerWithFlags<HCERTSTORE, |
| 38 CertCloseStore, 0> > ScopedHCERTSTORE; | 36 CertCloseStore, 0> > ScopedHCERTSTORE; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 X509_ASN_ENCODING, | 487 X509_ASN_ENCODING, |
| 490 CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT, | 488 CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT, |
| 491 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)), | 489 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)), |
| 492 CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT, | 490 CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT, |
| 493 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)), | 491 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)), |
| 494 0, | 492 0, |
| 495 NULL); | 493 NULL); |
| 496 } | 494 } |
| 497 | 495 |
| 498 } // namespace net | 496 } // namespace net |
| OLD | NEW |