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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/string_tokenizer.h" | 9 #include "base/string_tokenizer.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" |
11 #include "net/base/cert_status_flags.h" | 12 #include "net/base/cert_status_flags.h" |
12 #include "net/base/cert_verify_result.h" | 13 #include "net/base/cert_verify_result.h" |
13 #include "net/base/ev_root_ca_metadata.h" | 14 #include "net/base/ev_root_ca_metadata.h" |
14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
15 #include "net/base/scoped_cert_chain_context.h" | 16 #include "net/base/scoped_cert_chain_context.h" |
16 | 17 |
17 #pragma comment(lib, "crypt32.lib") | 18 #pragma comment(lib, "crypt32.lib") |
18 | 19 |
19 using base::Time; | 20 using base::Time; |
20 | 21 |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 DWORD sha1_size = sizeof(sha1.data); | 768 DWORD sha1_size = sizeof(sha1.data); |
768 rv = CryptHashCertificate(NULL, CALG_SHA1, 0, cert->pbCertEncoded, | 769 rv = CryptHashCertificate(NULL, CALG_SHA1, 0, cert->pbCertEncoded, |
769 cert->cbCertEncoded, sha1.data, &sha1_size); | 770 cert->cbCertEncoded, sha1.data, &sha1_size); |
770 DCHECK(rv && sha1_size == sizeof(sha1.data)); | 771 DCHECK(rv && sha1_size == sizeof(sha1.data)); |
771 if (!rv) | 772 if (!rv) |
772 memset(sha1.data, 0, sizeof(sha1.data)); | 773 memset(sha1.data, 0, sizeof(sha1.data)); |
773 return sha1; | 774 return sha1; |
774 } | 775 } |
775 | 776 |
776 } // namespace net | 777 } // namespace net |
OLD | NEW |