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/singleton.h" |
9 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
12 #include "net/base/cert_status_flags.h" | 13 #include "net/base/cert_status_flags.h" |
13 #include "net/base/cert_verify_result.h" | 14 #include "net/base/cert_verify_result.h" |
14 #include "net/base/ev_root_ca_metadata.h" | 15 #include "net/base/ev_root_ca_metadata.h" |
15 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
16 #include "net/base/scoped_cert_chain_context.h" | 17 #include "net/base/scoped_cert_chain_context.h" |
17 | 18 |
18 #pragma comment(lib, "crypt32.lib") | 19 #pragma comment(lib, "crypt32.lib") |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 DWORD sha1_size = sizeof(sha1.data); | 857 DWORD sha1_size = sizeof(sha1.data); |
857 rv = CryptHashCertificate(NULL, CALG_SHA1, 0, cert->pbCertEncoded, | 858 rv = CryptHashCertificate(NULL, CALG_SHA1, 0, cert->pbCertEncoded, |
858 cert->cbCertEncoded, sha1.data, &sha1_size); | 859 cert->cbCertEncoded, sha1.data, &sha1_size); |
859 DCHECK(rv && sha1_size == sizeof(sha1.data)); | 860 DCHECK(rv && sha1_size == sizeof(sha1.data)); |
860 if (!rv) | 861 if (!rv) |
861 memset(sha1.data, 0, sizeof(sha1.data)); | 862 memset(sha1.data, 0, sizeof(sha1.data)); |
862 return sha1; | 863 return sha1; |
863 } | 864 } |
864 | 865 |
865 } // namespace net | 866 } // namespace net |
OLD | NEW |