OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "net/base/cert_status_flags.h" | 12 #include "net/base/cert_status_flags.h" |
13 #include "net/base/ev_root_ca_metadata.h" | 13 #include "net/base/ev_root_ca_metadata.h" |
14 #include "net/base/scoped_cert_chain_context.h" | 14 #include "net/base/scoped_cert_chain_context.h" |
15 | 15 |
16 #pragma comment(lib, "crypt32.lib") | 16 #pragma comment(lib, "crypt32.lib") |
17 | 17 |
| 18 using base::Time; |
| 19 |
18 namespace net { | 20 namespace net { |
19 | 21 |
20 namespace { | 22 namespace { |
21 | 23 |
22 // Calculates the SHA-1 fingerprint of the certificate. Returns an empty | 24 // Calculates the SHA-1 fingerprint of the certificate. Returns an empty |
23 // (all zero) fingerprint on failure. | 25 // (all zero) fingerprint on failure. |
24 X509Certificate::Fingerprint CalculateFingerprint(PCCERT_CONTEXT cert) { | 26 X509Certificate::Fingerprint CalculateFingerprint(PCCERT_CONTEXT cert) { |
25 DCHECK(NULL != cert->pbCertEncoded); | 27 DCHECK(NULL != cert->pbCertEncoded); |
26 DCHECK(0 != cert->cbCertEncoded); | 28 DCHECK(0 != cert->cbCertEncoded); |
27 | 29 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 scoped_ptr_malloc<CERT_POLICIES_INFO> policies_info; | 417 scoped_ptr_malloc<CERT_POLICIES_INFO> policies_info; |
416 GetCertPoliciesInfo(end_cert, &policies_info); | 418 GetCertPoliciesInfo(end_cert, &policies_info); |
417 if (!policies_info.get()) | 419 if (!policies_info.get()) |
418 return false; | 420 return false; |
419 | 421 |
420 return ContainsPolicy(policies_info.get(), ev_policy_oid.c_str()); | 422 return ContainsPolicy(policies_info.get(), ev_policy_oid.c_str()); |
421 } | 423 } |
422 | 424 |
423 } // namespace net | 425 } // namespace net |
424 | 426 |
OLD | NEW |