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 "chrome/browser/net/crl_set_fetcher.h" | 5 #include "chrome/browser/net/crl_set_fetcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/safe_numerics.h" | 11 #include "base/safe_numerics.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "chrome/browser/component_updater/component_updater_service.h" | 14 #include "chrome/browser/component_updater/component_updater_service.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "net/cert/crl_set.h" | 19 #include "net/cert/crl_set.h" |
20 #include "net/ssl/ssl_config_service.h" | 20 #include "net/ssl/ssl_config_service.h" |
21 | 21 |
| 22 using component_updater::ComponentUpdateService; |
22 using content::BrowserThread; | 23 using content::BrowserThread; |
23 | 24 |
24 CRLSetFetcher::CRLSetFetcher() : cus_(NULL) {} | 25 CRLSetFetcher::CRLSetFetcher() : cus_(NULL) {} |
25 | 26 |
26 bool CRLSetFetcher::GetCRLSetFilePath(base::FilePath* path) const { | 27 bool CRLSetFetcher::GetCRLSetFilePath(base::FilePath* path) const { |
27 bool ok = PathService::Get(chrome::DIR_USER_DATA, path); | 28 bool ok = PathService::Get(chrome::DIR_USER_DATA, path); |
28 if (!ok) { | 29 if (!ok) { |
29 NOTREACHED(); | 30 NOTREACHED(); |
30 return false; | 31 return false; |
31 } | 32 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 static const uint8 kPublicKeySHA256[32] = { | 115 static const uint8 kPublicKeySHA256[32] = { |
115 0x75, 0xda, 0xf8, 0xcb, 0x77, 0x68, 0x40, 0x33, | 116 0x75, 0xda, 0xf8, 0xcb, 0x77, 0x68, 0x40, 0x33, |
116 0x65, 0x4c, 0x97, 0xe5, 0xc5, 0x1b, 0xcd, 0x81, | 117 0x65, 0x4c, 0x97, 0xe5, 0xc5, 0x1b, 0xcd, 0x81, |
117 0x7b, 0x1e, 0xeb, 0x11, 0x2c, 0xe1, 0xa4, 0x33, | 118 0x7b, 0x1e, 0xeb, 0x11, 0x2c, 0xe1, 0xa4, 0x33, |
118 0x8c, 0xf5, 0x72, 0x5e, 0xed, 0xb8, 0x43, 0x97, | 119 0x8c, 0xf5, 0x72, 0x5e, 0xed, 0xb8, 0x43, 0x97, |
119 }; | 120 }; |
120 | 121 |
121 void CRLSetFetcher::RegisterComponent(uint32 sequence_of_loaded_crl) { | 122 void CRLSetFetcher::RegisterComponent(uint32 sequence_of_loaded_crl) { |
122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
123 | 124 |
124 CrxComponent component; | 125 component_updater::CrxComponent component; |
125 component.pk_hash.assign(kPublicKeySHA256, | 126 component.pk_hash.assign(kPublicKeySHA256, |
126 kPublicKeySHA256 + sizeof(kPublicKeySHA256)); | 127 kPublicKeySHA256 + sizeof(kPublicKeySHA256)); |
127 component.installer = this; | 128 component.installer = this; |
128 component.name = "CRLSet"; | 129 component.name = "CRLSet"; |
129 component.version = Version(base::UintToString(sequence_of_loaded_crl)); | 130 component.version = Version(base::UintToString(sequence_of_loaded_crl)); |
130 if (!component.version.IsValid()) { | 131 if (!component.version.IsValid()) { |
131 NOTREACHED(); | 132 NOTREACHED(); |
132 component.version = Version("0"); | 133 component.version = Version("0"); |
133 } | 134 } |
134 | 135 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 204 |
204 return true; | 205 return true; |
205 } | 206 } |
206 | 207 |
207 bool CRLSetFetcher::GetInstalledFile( | 208 bool CRLSetFetcher::GetInstalledFile( |
208 const std::string& file, base::FilePath* installed_file) { | 209 const std::string& file, base::FilePath* installed_file) { |
209 return false; | 210 return false; |
210 } | 211 } |
211 | 212 |
212 CRLSetFetcher::~CRLSetFetcher() {} | 213 CRLSetFetcher::~CRLSetFetcher() {} |
OLD | NEW |