Chromium Code Reviews| 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/win/enumerate_modules_model.h" | 5 #include "chrome/browser/win/enumerate_modules_model.h" |
| 6 | 6 |
| 7 #include <Tlhelp32.h> | 7 #include <softpub.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <tlhelp32.h> | |
| 11 #include <wincrypt.h> | |
| 10 #include <wintrust.h> | 12 #include <wintrust.h> |
| 13 #include <mscat.h> // NOLINT: This must be after wincrypt and wintrust. | |
| 11 | 14 |
| 12 #include <algorithm> | 15 #include <algorithm> |
| 13 #include <memory> | |
| 14 | 16 |
| 15 #include "base/bind.h" | 17 #include "base/bind.h" |
| 16 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/debug/leak_annotations.h" | |
| 17 #include "base/environment.h" | 20 #include "base/environment.h" |
| 18 #include "base/file_version_info.h" | 21 #include "base/file_version_info.h" |
| 19 #include "base/files/file_path.h" | 22 #include "base/files/file_path.h" |
| 20 #include "base/i18n/case_conversion.h" | 23 #include "base/i18n/case_conversion.h" |
| 21 #include "base/macros.h" | 24 #include "base/macros.h" |
| 22 #include "base/metrics/histogram.h" | 25 #include "base/metrics/histogram.h" |
| 26 #include "base/scoped_generic.h" | |
| 23 #include "base/strings/string_number_conversions.h" | 27 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_util.h" | 28 #include "base/strings/string_util.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| 27 #include "base/values.h" | 31 #include "base/values.h" |
| 28 #include "base/version.h" | 32 #include "base/version.h" |
| 29 #include "base/win/registry.h" | 33 #include "base/win/registry.h" |
| 30 #include "base/win/scoped_handle.h" | 34 #include "base/win/scoped_handle.h" |
| 31 #include "base/win/windows_version.h" | 35 #include "base/win/windows_version.h" |
| 32 #include "chrome/browser/chrome_notification_types.h" | |
| 33 #include "chrome/browser/net/service_providers_win.h" | 36 #include "chrome/browser/net/service_providers_win.h" |
| 34 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
| 35 #include "chrome/grit/generated_resources.h" | 38 #include "chrome/grit/generated_resources.h" |
| 36 #include "content/public/browser/notification_service.h" | |
| 37 #include "crypto/sha2.h" | 39 #include "crypto/sha2.h" |
| 38 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 39 | 41 |
| 40 using content::BrowserThread; | 42 using content::BrowserThread; |
| 41 | 43 |
| 42 // The period of time (in milliseconds) to wait until checking to see if any | |
| 43 // incompatible modules exist. | |
| 44 static const int kModuleCheckDelayMs = 45 * 1000; | |
| 45 | |
| 46 // The path to the Shell Extension key in the Windows registry. | 44 // The path to the Shell Extension key in the Windows registry. |
| 47 static const wchar_t kRegPath[] = | 45 static const wchar_t kRegPath[] = |
| 48 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"; | 46 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"; |
| 49 | 47 |
| 50 // Short-hand for things on the blacklist you should simply get rid of. | |
| 51 static const ModuleEnumerator::RecommendedAction kUninstallLink = | |
| 52 static_cast<ModuleEnumerator::RecommendedAction>( | |
| 53 ModuleEnumerator::UNINSTALL | ModuleEnumerator::SEE_LINK); | |
| 54 | |
| 55 // Short-hand for things on the blacklist we are investigating and have info. | |
| 56 static const ModuleEnumerator::RecommendedAction kInvestigatingLink = | |
| 57 static_cast<ModuleEnumerator::RecommendedAction>( | |
| 58 ModuleEnumerator::INVESTIGATING | ModuleEnumerator::SEE_LINK); | |
| 59 | |
| 60 // A sort method that sorts by bad modules first, then by full name (including | 48 // A sort method that sorts by bad modules first, then by full name (including |
| 61 // path). | 49 // path). |
| 62 static bool ModuleSort(const ModuleEnumerator::Module& a, | 50 static bool ModuleSort(const ModuleEnumerator::Module& a, |
| 63 const ModuleEnumerator::Module& b) { | 51 const ModuleEnumerator::Module& b) { |
| 64 if (a.status != b.status) | 52 if (a.status != b.status) |
| 65 return a.status > b.status; | 53 return a.status > b.status; |
| 66 | 54 |
| 67 if (a.location == b.location) | 55 if (a.location == b.location) |
| 68 return a.name < b.name; | 56 return a.name < b.name; |
| 69 | 57 |
| 70 return a.location < b.location; | 58 return a.location < b.location; |
| 71 } | 59 } |
| 72 | 60 |
| 73 namespace { | 61 namespace { |
| 74 | 62 |
| 75 // Used to protect the LoadedModuleVector which is accessed | |
| 76 // from both the UI thread and the FILE thread. | |
| 77 base::Lock* lock = NULL; | |
| 78 | |
| 79 // A struct to help de-duping modules before adding them to the enumerated | 63 // A struct to help de-duping modules before adding them to the enumerated |
| 80 // modules vector. | 64 // modules vector. |
| 81 struct FindModule { | 65 struct FindModule { |
| 82 public: | 66 public: |
| 83 explicit FindModule(const ModuleEnumerator::Module& x) | 67 explicit FindModule(const ModuleEnumerator::Module& x) |
| 84 : module(x) {} | 68 : module(x) {} |
| 85 bool operator()(const ModuleEnumerator::Module& module_in) const { | 69 bool operator()(const ModuleEnumerator::Module& module_in) const { |
| 86 return (module.location == module_in.location) && | 70 return (module.location == module_in.location) && |
| 87 (module.name == module_in.name); | 71 (module.name == module_in.name); |
| 88 } | 72 } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 99 DWORD return_value = GetLongPathName(short_path.c_str(), long_path_buf, | 83 DWORD return_value = GetLongPathName(short_path.c_str(), long_path_buf, |
| 100 MAX_PATH); | 84 MAX_PATH); |
| 101 if (return_value != 0 && return_value < MAX_PATH) { | 85 if (return_value != 0 && return_value < MAX_PATH) { |
| 102 *long_path = long_path_buf; | 86 *long_path = long_path_buf; |
| 103 return true; | 87 return true; |
| 104 } | 88 } |
| 105 | 89 |
| 106 return false; | 90 return false; |
| 107 } | 91 } |
| 108 | 92 |
| 93 // Returns the "Subject" field from the digital signature in the provided | |
| 94 // binary, if any is present. Returns an empty string on failure. | |
| 95 base::string16 GetSubjectNameInFile(const base::FilePath& filename) { | |
| 96 HCERTSTORE store = nullptr; | |
| 97 HCRYPTMSG message = nullptr; | |
| 98 | |
| 99 // Find the crypto message for this filename. | |
| 100 bool result = !!CryptQueryObject(CERT_QUERY_OBJECT_FILE, | |
| 101 filename.value().c_str(), | |
| 102 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, | |
| 103 CERT_QUERY_FORMAT_FLAG_BINARY, | |
| 104 0, | |
| 105 nullptr, | |
| 106 nullptr, | |
| 107 nullptr, | |
| 108 &store, | |
| 109 &message, | |
| 110 nullptr); | |
| 111 if (!result) | |
| 112 return base::string16(); | |
| 113 | |
| 114 // Determine the size of the signer info data. | |
| 115 DWORD signer_info_size = 0; | |
| 116 result = !!CryptMsgGetParam(message, | |
| 117 CMSG_SIGNER_INFO_PARAM, | |
| 118 0, | |
| 119 nullptr, | |
| 120 &signer_info_size); | |
| 121 if (!result) | |
| 122 return base::string16(); | |
| 123 | |
| 124 // Allocate enough space to hold the signer info. | |
| 125 std::unique_ptr<BYTE[]> signer_info_buffer(new BYTE[signer_info_size]); | |
| 126 CMSG_SIGNER_INFO* signer_info = | |
| 127 reinterpret_cast<CMSG_SIGNER_INFO*>(signer_info_buffer.get()); | |
| 128 | |
| 129 // Obtain the signer info. | |
| 130 result = !!CryptMsgGetParam(message, | |
| 131 CMSG_SIGNER_INFO_PARAM, | |
| 132 0, | |
| 133 signer_info, | |
| 134 &signer_info_size); | |
| 135 if (!result) | |
| 136 return base::string16(); | |
| 137 | |
|
cpu_(ooo_6.6-7.5)
2016/08/11 15:00:57
you need to close |store| and free |message|
grt (UTC plus 2)
2016/08/12 07:56:05
Indeed! I didn't review this code since it looked
chrisha
2016/08/12 19:04:41
Indeed it was only moved. I suppose I should have
chrisha
2016/08/12 19:04:41
Ach... copy and pasted code, thanks for catching t
| |
| 138 // Search for the signer certificate. | |
| 139 CERT_INFO CertInfo = {0}; | |
| 140 PCCERT_CONTEXT cert_context = nullptr; | |
| 141 CertInfo.Issuer = signer_info->Issuer; | |
| 142 CertInfo.SerialNumber = signer_info->SerialNumber; | |
| 143 | |
| 144 cert_context = CertFindCertificateInStore( | |
| 145 store, | |
| 146 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, | |
| 147 0, | |
| 148 CERT_FIND_SUBJECT_CERT, | |
| 149 &CertInfo, | |
| 150 nullptr); | |
| 151 if (!cert_context) | |
| 152 return base::string16(); | |
| 153 | |
| 154 // Determine the size of the Subject name. | |
| 155 DWORD subject_name_size = CertGetNameString( | |
| 156 cert_context, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, nullptr, nullptr, 0); | |
| 157 if (!subject_name_size) | |
| 158 return base::string16(); | |
| 159 | |
| 160 base::string16 subject_name; | |
| 161 subject_name.resize(subject_name_size); | |
| 162 | |
| 163 // Get subject name. | |
| 164 if (!(CertGetNameString(cert_context, | |
| 165 CERT_NAME_SIMPLE_DISPLAY_TYPE, | |
| 166 0, | |
| 167 nullptr, | |
| 168 const_cast<LPWSTR>(subject_name.c_str()), | |
| 169 subject_name_size))) { | |
| 170 return base::string16(); | |
| 171 } | |
| 172 | |
| 173 return subject_name; | |
| 174 } | |
| 175 | |
| 176 // Helper for scoped tracking a catalog admin context. | |
| 177 struct CryptCATContextScopedTraits { | |
| 178 static PVOID InvalidValue() { return nullptr; } | |
| 179 static void Free(PVOID context) { | |
| 180 CryptCATAdminReleaseContext(context, 0); | |
| 181 } | |
| 182 }; | |
| 183 using ScopedCryptCATContext = | |
| 184 base::ScopedGeneric<PVOID, CryptCATContextScopedTraits>; | |
| 185 | |
| 186 // Helper for scoped tracking of a catalog context. A catalog context is only | |
| 187 // valid with an associated admin context, so this is effectively a std::pair. | |
| 188 // A custom operator!= is required in order for a null |catalog_context| but | |
| 189 // non-null |context| to compare equal to the InvalidValue exposed by the | |
| 190 // traits class. | |
| 191 class CryptCATCatalogContext { | |
| 192 public: | |
| 193 CryptCATCatalogContext(PVOID context, PVOID catalog_context) | |
| 194 : context_(context), catalog_context_(catalog_context) {} | |
| 195 | |
| 196 bool operator!=(const CryptCATCatalogContext& rhs) const { | |
| 197 return catalog_context_ != rhs.catalog_context_; | |
| 198 } | |
| 199 | |
| 200 PVOID context() const { return context_; } | |
| 201 PVOID catalog_context() const { return catalog_context_; } | |
| 202 | |
| 203 private: | |
| 204 PVOID context_; | |
| 205 PVOID catalog_context_; | |
| 206 }; | |
| 207 | |
| 208 struct CryptCATCatalogContextScopedTraits { | |
| 209 static CryptCATCatalogContext InvalidValue() { | |
| 210 return CryptCATCatalogContext(nullptr, nullptr); | |
| 211 } | |
| 212 static void Free(const CryptCATCatalogContext& c) { | |
| 213 CryptCATAdminReleaseCatalogContext( | |
| 214 c.context(), c.catalog_context(), 0); | |
| 215 } | |
| 216 }; | |
| 217 using ScopedCryptCATCatalogContext = base::ScopedGeneric< | |
| 218 CryptCATCatalogContext, CryptCATCatalogContextScopedTraits>; | |
| 219 | |
| 220 // Returns the "Subject" field associated with the certificate that signs | |
| 221 // the catalog in which the given file is found, if any. Returns an empty string | |
| 222 // on failure. | |
| 223 base::string16 GetSubjectNameInCatalog(const base::FilePath& filename) { | |
| 224 // Get a crypt context for signature verification. | |
| 225 ScopedCryptCATContext context; | |
| 226 { | |
| 227 PVOID raw_context = nullptr; | |
| 228 if (!CryptCATAdminAcquireContext(&raw_context, nullptr, 0)) | |
| 229 return base::string16(); | |
| 230 context.reset(raw_context); | |
| 231 } | |
| 232 | |
| 233 // Open the file of interest. | |
| 234 base::win::ScopedHandle file_handle(CreateFileW( | |
| 235 filename.value().c_str(), GENERIC_READ, | |
| 236 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, | |
| 237 nullptr, OPEN_EXISTING, 0, nullptr)); | |
| 238 if (!file_handle.IsValid()) | |
| 239 return base::string16(); | |
| 240 | |
| 241 // Get the size we need for our hash. | |
| 242 DWORD hash_size = 0; | |
| 243 CryptCATAdminCalcHashFromFileHandle( | |
| 244 file_handle.Get(), &hash_size, nullptr, 0); | |
| 245 if (hash_size == 0) | |
| 246 return base::string16(); | |
| 247 | |
| 248 // Calculate the hash. If this fails then bail. | |
| 249 std::vector<BYTE> buffer(hash_size); | |
| 250 if (!CryptCATAdminCalcHashFromFileHandle(file_handle.Get(), &hash_size, | |
| 251 buffer.data(), 0)) { | |
|
Lei Zhang
2016/08/04 14:33:32
indentation looks a bit weird. git cl format the w
chrisha
2016/08/12 19:04:40
Done.
| |
| 252 return base::string16(); | |
| 253 } | |
| 254 | |
| 255 // Get catalog for our context. | |
| 256 ScopedCryptCATCatalogContext catalog_context(CryptCATCatalogContext( | |
| 257 context.get(), | |
| 258 CryptCATAdminEnumCatalogFromHash(context.get(), buffer.data(), hash_size, | |
| 259 0, nullptr))); | |
| 260 if (!catalog_context.is_valid()) | |
| 261 return base::string16(); | |
| 262 | |
| 263 // Get the catalog info. This includes the path to the catalog itself, which | |
| 264 // contains the signature of interest. | |
| 265 CATALOG_INFO catalog_info = {}; | |
| 266 catalog_info.cbStruct = sizeof(catalog_info); | |
| 267 if (!CryptCATCatalogInfoFromContext( | |
| 268 catalog_context.get().catalog_context(), &catalog_info, 0)) { | |
| 269 return base::string16(); | |
| 270 } | |
| 271 | |
| 272 // Attempt to get the "Subject" field from the signature of the catalog file | |
| 273 // itself. | |
| 274 base::FilePath catalog_path(catalog_info.wszCatalogFile); | |
| 275 return GetSubjectNameInFile(catalog_path); | |
| 276 } | |
| 277 | |
| 109 } // namespace | 278 } // namespace |
| 110 | 279 |
| 111 ModuleEnumerator::Module::Module() { | 280 ModuleEnumerator::Module::Module() { |
| 112 } | 281 } |
| 113 | 282 |
| 114 ModuleEnumerator::Module::Module(const Module& rhs) = default; | 283 ModuleEnumerator::Module::Module(const Module& rhs) = default; |
| 115 | 284 |
| 116 ModuleEnumerator::Module::Module(ModuleType type, | 285 ModuleEnumerator::Module::Module(ModuleType type, |
| 117 ModuleStatus status, | 286 ModuleStatus status, |
| 118 const base::string16& location, | 287 const base::string16& location, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 131 version(version), | 300 version(version), |
| 132 digital_signer(digital_signer), | 301 digital_signer(digital_signer), |
| 133 recommended_action(recommended_action), | 302 recommended_action(recommended_action), |
| 134 duplicate_count(0), | 303 duplicate_count(0), |
| 135 normalized(false) { | 304 normalized(false) { |
| 136 } | 305 } |
| 137 | 306 |
| 138 ModuleEnumerator::Module::~Module() { | 307 ModuleEnumerator::Module::~Module() { |
| 139 } | 308 } |
| 140 | 309 |
| 141 // The browser process module blacklist. This lists modules that are known | |
| 142 // to cause compatibility issues within the browser process. When adding to this | |
| 143 // list, make sure that all paths are lower-case, in long pathname form, end | |
| 144 // with a slash and use environments variables (or just look at one of the | |
| 145 // comments below and keep it consistent with that). When adding an entry with | |
| 146 // an environment variable not currently used in the list below, make sure to | |
| 147 // update the list in PreparePathMappings. Filename, Description/Signer, and | |
| 148 // Location must be entered as hashes (see GenerateHash). Filename is mandatory. | |
| 149 // Entries without any Description, Signer info, or Location will never be | |
| 150 // marked as confirmed bad (only as suspicious). | |
| 151 const ModuleEnumerator::BlacklistEntry ModuleEnumerator::kModuleBlacklist[] = { | |
| 152 // NOTE: Please keep this list sorted by dll name, then location. | |
| 153 | |
| 154 // Version 3.2.1.6 seems to be implicated in most cases (and 3.2.2.2 in some). | |
| 155 // There is a more recent version available for download. | |
| 156 // accelerator.dll, "%programfiles%\\speedbit video accelerator\\". | |
| 157 { "7ba9402f", "c9132d48", "", "", "", ALL, kInvestigatingLink }, | |
| 158 | |
| 159 // apiqq0.dll, "%temp%\\". | |
| 160 { "26134911", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 161 | |
| 162 // arking0.dll, "%systemroot%\\system32\\". | |
| 163 { "f5d8f549", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 164 | |
| 165 // arking1.dll, "%systemroot%\\system32\\". | |
| 166 { "c60ca062", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 167 | |
| 168 // aswjsflt.dll, "%ProgramFiles%\\avast software\\avast\\", "AVAST Software". | |
| 169 // NOTE: The digital signature of the DLL is double null terminated. | |
| 170 // Avast Antivirus prior to version 8.0 would kill the Chrome child process | |
| 171 // when blocked from running. | |
| 172 { "2ea5422a", "6b3a1b00", "a7db0e0c", "", "8.0", XP, | |
| 173 static_cast<RecommendedAction>(UPDATE | SEE_LINK | NOTIFY_USER) }, | |
| 174 | |
| 175 // aswjsflt.dll, "%ProgramFiles%\\alwil software\\avast5\\", "AVAST Software". | |
| 176 // NOTE: The digital signature of the DLL is double null terminated. | |
| 177 // Avast Antivirus prior to version 8.0 would kill the Chrome child process | |
| 178 // when blocked from running. | |
| 179 { "2ea5422a", "d8686924", "a7db0e0c", "", "8.0", XP, | |
| 180 static_cast<RecommendedAction>(UPDATE | SEE_LINK | NOTIFY_USER) }, | |
| 181 | |
| 182 // Said to belong to Killer NIC from BigFoot Networks (not verified). Versions | |
| 183 // 6.0.0.7 and 6.0.0.10 implicated. | |
| 184 // bfllr.dll, "%systemroot%\\system32\\". | |
| 185 { "6bb57633", "23d01d5b", "", "", "", ALL, kInvestigatingLink }, | |
| 186 | |
| 187 // clickpotatolitesahook.dll, "". Different version each report. | |
| 188 { "0396e037.dll", "", "", "", "", ALL, kUninstallLink }, | |
| 189 | |
| 190 // cvasds0.dll, "%temp%\\". | |
| 191 { "5ce0037c", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 192 | |
| 193 // cwalsp.dll, "%systemroot%\\system32\\". | |
| 194 { "e579a039", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 195 | |
| 196 // datamngr.dll (1), "%programfiles%\\searchqu toolbar\\datamngr\\". | |
| 197 { "7add320b", "470a3da3", "", "", "", ALL, kUninstallLink }, | |
| 198 | |
| 199 // datamngr.dll (2), "%programfiles%\\windows searchqu toolbar\\". | |
| 200 { "7add320b", "7a3c8be3", "", "", "", ALL, kUninstallLink }, | |
| 201 | |
| 202 // dsoqq0.dll, "%temp%\\". | |
| 203 { "1c4df325", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 204 | |
| 205 // flt.dll, "%programfiles%\\tueagles\\". | |
| 206 { "6d01f4a1", "7935e9c2", "", "", "", ALL, kUninstallLink }, | |
| 207 | |
| 208 // This looks like a malware edition of a Brazilian Bank plugin, sometimes | |
| 209 // referred to as Malware.Banc.A. | |
| 210 // gbieh.dll, "%programfiles%\\gbplugin\\". | |
| 211 { "4cb4f2e3", "88e4a3b1", "", "", "", ALL, kUninstallLink }, | |
| 212 | |
| 213 // hblitesahook.dll. Each report has different version number in location. | |
| 214 { "5d10b363", "", "", "", "", ALL, kUninstallLink }, | |
| 215 | |
| 216 // icf.dll, "%systemroot%\\system32\\". | |
| 217 { "303825ed", "23d01d5b", "", "", "", ALL, INVESTIGATING }, | |
| 218 | |
| 219 // idmmbc.dll (IDM), "%systemroot%\\system32\\". See: http://crbug.com/26892/. | |
| 220 { "b8dce5c3", "23d01d5b", "", "", "6.03", ALL, | |
| 221 static_cast<RecommendedAction>(UPDATE | DISABLE) }, | |
| 222 | |
| 223 // imon.dll (NOD32), "%systemroot%\\system32\\". See: http://crbug.com/21715. | |
| 224 { "8f42f22e", "23d01d5b", "", "", "4.0", ALL, | |
| 225 static_cast<RecommendedAction>(UPDATE | DISABLE) }, | |
| 226 | |
| 227 // is3lsp.dll, "%commonprogramfiles%\\is3\\anti-spyware\\". | |
| 228 { "7ffbdce9", "bc5673f2", "", "", "", ALL, | |
| 229 static_cast<RecommendedAction>(UPDATE | DISABLE | SEE_LINK) }, | |
| 230 | |
| 231 // jsi.dll, "%programfiles%\\profilecraze\\". | |
| 232 { "f9555eea", "e3548061", "", "", "", ALL, kUninstallLink }, | |
| 233 | |
| 234 // kernel.dll, "%programfiles%\\contentwatch\\internet protection\\modules\\". | |
| 235 { "ead2768e", "4e61ce60", "", "", "", ALL, INVESTIGATING }, | |
| 236 | |
| 237 // mgking0.dll, "%systemroot%\\system32\\". | |
| 238 { "d0893e38", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 239 | |
| 240 // mgking0.dll, "%temp%\\". | |
| 241 { "d0893e38", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 242 | |
| 243 // mgking1.dll, "%systemroot%\\system32\\". | |
| 244 { "3e837222", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 245 | |
| 246 // mgking1.dll, "%temp%\\". | |
| 247 { "3e837222", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 248 | |
| 249 // mstcipha.ime, "%systemroot%\\system32\\". | |
| 250 { "5523579e", "23d01d5b", "", "", "", ALL, INVESTIGATING }, | |
| 251 | |
| 252 // mwtsp.dll, "%systemroot%\\system32\\". | |
| 253 { "9830bff6", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 254 | |
| 255 // nodqq0.dll, "%temp%\\". | |
| 256 { "b86ce04d", "59145acf", "", "", "", ALL, kUninstallLink }, | |
| 257 | |
| 258 // nProtect GameGuard Anti-cheat system. Every report has a different | |
| 259 // location, since it is installed into and run from a game folder. Various | |
| 260 // versions implicated. | |
| 261 // npggnt.des, no fixed location. | |
| 262 { "f2c8790d", "", "", "", "", ALL, kInvestigatingLink }, | |
| 263 | |
| 264 // nvlsp.dll, | |
| 265 // "%programfiles%\\nvidia corporation\\networkaccessmanager\\bin32\\". | |
| 266 { "37f907e2", "3ad0ff23", "", "", "", ALL, INVESTIGATING }, | |
| 267 | |
| 268 // post0.dll, "%systemroot%\\system32\\". | |
| 269 { "7405c0c8", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 270 | |
| 271 // questbrwsearch.dll, "%programfiles%\\questbrwsearch\\". | |
| 272 { "0953ed09", "f0d5eeda", "", "", "", ALL, kUninstallLink }, | |
| 273 | |
| 274 // questscan.dll, "%programfiles%\\questscan\\". | |
| 275 { "f4f3391e", "119d20f7", "", "", "", ALL, kUninstallLink }, | |
| 276 | |
| 277 // radhslib.dll (Naomi web filter), "%programfiles%\\rnamfler\\". | |
| 278 // See http://crbug.com/12517. | |
| 279 { "7edcd250", "0733dc3e", "", "", "", ALL, INVESTIGATING }, | |
| 280 | |
| 281 // rlls.dll, "%programfiles%\\relevantknowledge\\". | |
| 282 { "a1ed94a7", "ea9d6b36", "", "", "", ALL, kUninstallLink }, | |
| 283 | |
| 284 // rooksdol.dll, "%programfiles%\\trusteer\\rapport\\bin\\". | |
| 285 { "802aefef", "06120e13", "", "", "3.5.1008.40", ALL, UPDATE }, | |
| 286 | |
| 287 // scanquery.dll, "%programfiles%\\scanquery\\". | |
| 288 { "0b52d2ae", "a4cc88b1", "", "", "", ALL, kUninstallLink }, | |
| 289 | |
| 290 // sdata.dll, "%programdata%\\srtserv\\". | |
| 291 { "1936d5cc", "223c44be", "", "", "", ALL, kUninstallLink }, | |
| 292 | |
| 293 // searchtree.dll, | |
| 294 // "%programfiles%\\contentwatch\\internet protection\\modules\\". | |
| 295 { "f6915a31", "4e61ce60", "", "", "", ALL, INVESTIGATING }, | |
| 296 | |
| 297 // sgprxy.dll, "%commonprogramfiles%\\is3\\anti-spyware\\". | |
| 298 { "005965ea", "bc5673f2", "", "", "", ALL, INVESTIGATING }, | |
| 299 | |
| 300 // snxhk.dll, "%ProgramFiles%\\avast software\\avast\\", "AVAST Software". | |
| 301 // NOTE: The digital signature of the DLL is double null terminated. | |
| 302 // Avast Antivirus prior to version 8.0 would kill the Chrome child process | |
| 303 // when blocked from running. | |
| 304 { "46c16aa8", "6b3a1b00", "a7db0e0c", "", "8.0", XP, | |
| 305 static_cast<RecommendedAction>(UPDATE | SEE_LINK | NOTIFY_USER) }, | |
| 306 | |
| 307 // snxhk.dll, "%ProgramFiles%\\alwil software\\avast5\\", "AVAST Software". | |
| 308 // NOTE: The digital signature of the DLL is double null terminated. | |
| 309 // Avast Antivirus prior to version 8.0 would kill the Chrome child process | |
| 310 // when blocked from running. | |
| 311 { "46c16aa8", "d8686924", "a7db0e0c", "", "8.0", XP, | |
| 312 static_cast<RecommendedAction>(UPDATE | SEE_LINK | NOTIFY_USER) }, | |
| 313 | |
| 314 // sprotector.dll, "". Different location each report. | |
| 315 { "24555d74", "", "", "", "", ALL, kUninstallLink }, | |
| 316 | |
| 317 // swi_filter_0001.dll (Sophos Web Intelligence), | |
| 318 // "%programfiles%\\sophos\\sophos anti-virus\\web intelligence\\". | |
| 319 // A small random sample all showed version 1.0.5.0. | |
| 320 { "61112d7b", "25fb120f", "", "", "", ALL, kInvestigatingLink }, | |
| 321 | |
| 322 // twking0.dll, "%systemroot%\\system32\\". | |
| 323 { "0355549b", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 324 | |
| 325 // twking1.dll, "%systemroot%\\system32\\". | |
| 326 { "02e44508", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 327 | |
| 328 // vksaver.dll, "%systemroot%\\system32\\". | |
| 329 { "c4a784d5", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 330 | |
| 331 // vlsp.dll (Venturi Firewall?), "%systemroot%\\system32\\". | |
| 332 { "2e4eb93d", "23d01d5b", "", "", "", ALL, INVESTIGATING }, | |
| 333 | |
| 334 // vmn3_1dn.dll, "%appdata%\\roaming\\vmndtxtb\\". | |
| 335 { "bba2037d", "9ab68585", "", "", "", ALL, kUninstallLink }, | |
| 336 | |
| 337 // webanalyzer.dll, | |
| 338 // "%programfiles%\\contentwatch\\internet protection\\modules\\". | |
| 339 { "c70b697d", "4e61ce60", "", "", "", ALL, INVESTIGATING }, | |
| 340 | |
| 341 // wowst0.dll, "%systemroot%\\system32\\". | |
| 342 { "38ad9963", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 343 | |
| 344 // wxbase28u_vc_cw.dll, "%systemroot%\\system32\\". | |
| 345 { "e967210d", "23d01d5b", "", "", "", ALL, kUninstallLink }, | |
| 346 }; | |
| 347 | |
| 348 // Generates an 8 digit hash from the input given. | |
| 349 static void GenerateHash(const std::string& input, std::string* output) { | |
| 350 if (input.empty()) { | |
| 351 *output = ""; | |
| 352 return; | |
| 353 } | |
| 354 | |
| 355 uint8_t hash[4]; | |
| 356 crypto::SHA256HashString(input, hash, sizeof(hash)); | |
| 357 *output = base::ToLowerASCII(base::HexEncode(hash, sizeof(hash))); | |
| 358 } | |
| 359 | |
| 360 // ----------------------------------------------------------------------------- | 310 // ----------------------------------------------------------------------------- |
| 361 | 311 |
| 362 // static | 312 // static |
| 363 void ModuleEnumerator::NormalizeModule(Module* module) { | 313 void ModuleEnumerator::NormalizeModule(Module* module) { |
| 364 base::string16 path = module->location; | 314 base::string16 path = module->location; |
| 365 if (!ConvertToLongPath(path, &module->location)) | 315 if (!ConvertToLongPath(path, &module->location)) |
| 366 module->location = path; | 316 module->location = path; |
| 367 | 317 |
| 368 module->location = base::i18n::ToLower(module->location); | 318 module->location = base::i18n::ToLower(module->location); |
| 369 | 319 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 380 | 330 |
| 381 // Some version strings have things like (win7_rtm.090713-1255) appended | 331 // Some version strings have things like (win7_rtm.090713-1255) appended |
| 382 // to them. Remove that. | 332 // to them. Remove that. |
| 383 size_t first_space = module->version.find_first_of(L" "); | 333 size_t first_space = module->version.find_first_of(L" "); |
| 384 if (first_space != base::string16::npos) | 334 if (first_space != base::string16::npos) |
| 385 module->version = module->version.substr(0, first_space); | 335 module->version = module->version.substr(0, first_space); |
| 386 | 336 |
| 387 module->normalized = true; | 337 module->normalized = true; |
| 388 } | 338 } |
| 389 | 339 |
| 390 // static | 340 ModuleEnumerator::ModuleEnumerator(EnumerateModulesModel* observer) |
| 391 ModuleEnumerator::ModuleStatus ModuleEnumerator::Match( | 341 : enumerated_modules_(nullptr), |
| 392 const ModuleEnumerator::Module& module, | 342 observer_(observer) { |
| 393 const ModuleEnumerator::BlacklistEntry& blacklisted) { | |
| 394 // All modules must be normalized before matching against blacklist. | |
| 395 DCHECK(module.normalized); | |
| 396 // Filename is mandatory and version should not contain spaces. | |
| 397 DCHECK(strlen(blacklisted.filename) > 0); | |
| 398 DCHECK(!strstr(blacklisted.version_from, " ")); | |
| 399 DCHECK(!strstr(blacklisted.version_to, " ")); | |
| 400 | |
| 401 base::win::Version version = base::win::GetVersion(); | |
| 402 switch (version) { | |
| 403 case base::win::VERSION_XP: | |
| 404 if (!(blacklisted.os & XP)) return NOT_MATCHED; | |
| 405 break; | |
| 406 default: | |
| 407 break; | |
| 408 } | |
| 409 | |
| 410 std::string filename_hash, location_hash; | |
| 411 GenerateHash(base::WideToUTF8(module.name), &filename_hash); | |
| 412 GenerateHash(base::WideToUTF8(module.location), &location_hash); | |
| 413 | |
| 414 // Filenames are mandatory. Location is mandatory if given. | |
| 415 if (filename_hash == blacklisted.filename && | |
| 416 (std::string(blacklisted.location).empty() || | |
| 417 location_hash == blacklisted.location)) { | |
| 418 // We have a name match against the blacklist (and possibly location match | |
| 419 // also), so check version. | |
| 420 Version module_version(base::UTF16ToASCII(module.version)); | |
| 421 Version version_min(blacklisted.version_from); | |
| 422 Version version_max(blacklisted.version_to); | |
| 423 bool version_ok = !version_min.IsValid() && !version_max.IsValid(); | |
| 424 if (!version_ok) { | |
| 425 bool too_low = version_min.IsValid() && | |
| 426 (!module_version.IsValid() || | |
| 427 module_version.CompareTo(version_min) < 0); | |
| 428 bool too_high = version_max.IsValid() && | |
| 429 (!module_version.IsValid() || | |
| 430 module_version.CompareTo(version_max) >= 0); | |
| 431 version_ok = !too_low && !too_high; | |
| 432 } | |
| 433 | |
| 434 if (version_ok) { | |
| 435 // At this point, the names match and there is no version specified | |
| 436 // or the versions also match. | |
| 437 | |
| 438 std::string desc_or_signer(blacklisted.desc_or_signer); | |
| 439 std::string signer_hash, description_hash; | |
| 440 GenerateHash(base::WideToUTF8(module.digital_signer), &signer_hash); | |
| 441 GenerateHash(base::WideToUTF8(module.description), &description_hash); | |
| 442 | |
| 443 // If signatures match (or both are empty), then we have a winner. | |
| 444 if (signer_hash == desc_or_signer) | |
| 445 return CONFIRMED_BAD; | |
| 446 | |
| 447 // If descriptions match (or both are empty) and the locations match, then | |
| 448 // we also have a confirmed match. | |
| 449 if (description_hash == desc_or_signer && | |
| 450 !location_hash.empty() && location_hash == blacklisted.location) | |
| 451 return CONFIRMED_BAD; | |
| 452 | |
| 453 // We are not sure, but it is likely bad. | |
| 454 return SUSPECTED_BAD; | |
| 455 } | |
| 456 } | |
| 457 | |
| 458 return NOT_MATCHED; | |
| 459 } | 343 } |
| 460 | 344 |
| 461 ModuleEnumerator::ModuleEnumerator(EnumerateModulesModel* observer) | 345 void ModuleEnumerator::ScanNow(ModulesVector* list) { |
| 462 : enumerated_modules_(NULL), | 346 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 463 observer_(observer), | |
| 464 limited_mode_(false), | |
| 465 callback_thread_id_(BrowserThread::ID_COUNT) { | |
| 466 } | |
| 467 | |
| 468 void ModuleEnumerator::ScanNow(ModulesVector* list, bool limited_mode) { | |
| 469 enumerated_modules_ = list; | 347 enumerated_modules_ = list; |
| 470 | 348 |
| 471 limited_mode_ = limited_mode; | 349 // This object can't be reaped until it has finished scanning, so its safe |
| 472 | 350 // to post a raw pointer to another thread. |
| 473 if (!limited_mode_) { | 351 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 474 CHECK(BrowserThread::GetCurrentThreadIdentifier(&callback_thread_id_)); | 352 base::Bind(&ModuleEnumerator::ScanImpl, |
| 475 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 353 base::Unretained(this))); |
| 476 base::Bind(&ModuleEnumerator::ScanImpl, this)); | |
| 477 } else { | |
| 478 // Run it synchronously. | |
| 479 ScanImpl(); | |
| 480 } | |
| 481 } | |
| 482 | |
| 483 ModuleEnumerator::~ModuleEnumerator() { | |
| 484 } | 354 } |
| 485 | 355 |
| 486 void ModuleEnumerator::ScanImpl() { | 356 void ModuleEnumerator::ScanImpl() { |
| 487 base::TimeTicks start_time = base::TimeTicks::Now(); | 357 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 488 | 358 |
| 489 enumerated_modules_->clear(); | 359 enumerated_modules_->clear(); |
| 490 | 360 |
| 491 // Make sure the path mapping vector is setup so we can collapse paths. | 361 // Make sure the path mapping vector is setup so we can collapse paths. |
| 492 PreparePathMappings(); | 362 PreparePathMappings(); |
| 493 | 363 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 504 checkpoint2 = base::TimeTicks::Now(); | 374 checkpoint2 = base::TimeTicks::Now(); |
| 505 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions", | 375 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions", |
| 506 checkpoint2 - checkpoint); | 376 checkpoint2 - checkpoint); |
| 507 | 377 |
| 508 checkpoint = checkpoint2; | 378 checkpoint = checkpoint2; |
| 509 EnumerateWinsockModules(); | 379 EnumerateWinsockModules(); |
| 510 checkpoint2 = base::TimeTicks::Now(); | 380 checkpoint2 = base::TimeTicks::Now(); |
| 511 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules", | 381 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules", |
| 512 checkpoint2 - checkpoint); | 382 checkpoint2 - checkpoint); |
| 513 | 383 |
| 514 MatchAgainstBlacklist(); | 384 // TODO(chrisha): Annotate any modules that are suspicious/bad. |
| 385 | |
| 386 ReportThirdPartyMetrics(); | |
| 515 | 387 |
| 516 std::sort(enumerated_modules_->begin(), | 388 std::sort(enumerated_modules_->begin(), |
| 517 enumerated_modules_->end(), ModuleSort); | 389 enumerated_modules_->end(), ModuleSort); |
| 518 | 390 |
| 519 if (!limited_mode_) { | |
| 520 // Send a reply back on the UI thread. | |
| 521 BrowserThread::PostTask(callback_thread_id_, FROM_HERE, | |
| 522 base::Bind(&ModuleEnumerator::ReportBack, this)); | |
| 523 } else { | |
| 524 // We are on the main thread already. | |
| 525 ReportBack(); | |
| 526 } | |
| 527 | |
| 528 UMA_HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime", | 391 UMA_HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime", |
| 529 base::TimeTicks::Now() - start_time); | 392 base::TimeTicks::Now() - start_time); |
| 393 | |
| 394 // Send a reply back on the UI thread. The |observer_| is a leaky singleton | |
|
Lei Zhang
2016/08/04 14:33:32
While the leaky singleton part is true, it's not a
chrisha
2016/08/12 19:04:41
Fair enough. Done.
| |
| 395 // and will always be around, so posting a raw pointer is safe. This is done | |
| 396 // last as DoneScanning will reap this ModuleEnumerator. | |
| 397 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | |
| 398 base::Bind(&EnumerateModulesModel::DoneScanning, | |
| 399 base::Unretained(observer_))); | |
| 530 } | 400 } |
| 531 | 401 |
| 532 void ModuleEnumerator::EnumerateLoadedModules() { | 402 void ModuleEnumerator::EnumerateLoadedModules() { |
| 533 // Get all modules in the current process. | 403 // Get all modules in the current process. |
| 534 base::win::ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, | 404 base::win::ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, |
| 535 ::GetCurrentProcessId())); | 405 ::GetCurrentProcessId())); |
| 536 if (!snap.Get()) | 406 if (!snap.Get()) |
| 537 return; | 407 return; |
| 538 | 408 |
| 539 // Walk the module list. | 409 // Walk the module list. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 location.substr(prefix.length() - 1); | 566 location.substr(prefix.length() - 1); |
| 697 size_t length = new_location.length() - mapping->second.length(); | 567 size_t length = new_location.length() - mapping->second.length(); |
| 698 if (length < min_length) { | 568 if (length < min_length) { |
| 699 entry->location = new_location; | 569 entry->location = new_location; |
| 700 min_length = length; | 570 min_length = length; |
| 701 } | 571 } |
| 702 } | 572 } |
| 703 } | 573 } |
| 704 } | 574 } |
| 705 | 575 |
| 706 void ModuleEnumerator::MatchAgainstBlacklist() { | |
| 707 for (size_t m = 0; m < enumerated_modules_->size(); ++m) { | |
| 708 // Match this module against the blacklist. | |
| 709 Module* module = &(*enumerated_modules_)[m]; | |
| 710 module->status = GOOD; // We change this below potentially. | |
| 711 for (size_t i = 0; i < arraysize(kModuleBlacklist); ++i) { | |
| 712 #if !defined(NDEBUG) | |
| 713 // This saves time when constructing the blacklist. | |
| 714 std::string hashes(kModuleBlacklist[i].filename); | |
| 715 std::string hash1, hash2, hash3; | |
| 716 GenerateHash(kModuleBlacklist[i].filename, &hash1); | |
| 717 hashes += " - " + hash1; | |
| 718 GenerateHash(kModuleBlacklist[i].location, &hash2); | |
| 719 hashes += " - " + hash2; | |
| 720 GenerateHash(kModuleBlacklist[i].desc_or_signer, &hash3); | |
| 721 hashes += " - " + hash3; | |
| 722 #endif | |
| 723 | |
| 724 ModuleStatus status = Match(*module, kModuleBlacklist[i]); | |
| 725 if (status != NOT_MATCHED) { | |
| 726 // We have a match against the blacklist. Mark it as such. | |
| 727 module->status = status; | |
| 728 module->recommended_action = kModuleBlacklist[i].help_tip; | |
| 729 break; | |
| 730 } | |
| 731 } | |
| 732 | |
| 733 // Modules loaded from these locations are frequently malicious | |
| 734 // and notorious for changing frequently so they are not good candidates | |
| 735 // for blacklisting individually. Mark them as suspicious if we haven't | |
| 736 // classified them as bad yet. | |
| 737 if (module->status == NOT_MATCHED || module->status == GOOD) { | |
| 738 if (base::StartsWith(module->location, L"%temp%", | |
| 739 base::CompareCase::INSENSITIVE_ASCII) || | |
| 740 base::StartsWith(module->location, L"%tmp%", | |
| 741 base::CompareCase::INSENSITIVE_ASCII)) { | |
| 742 module->status = SUSPECTED_BAD; | |
| 743 } | |
| 744 } | |
| 745 } | |
| 746 } | |
| 747 | |
| 748 void ModuleEnumerator::ReportBack() { | |
| 749 if (!limited_mode_) | |
| 750 DCHECK_CURRENTLY_ON(callback_thread_id_); | |
| 751 observer_->DoneScanning(); | |
| 752 } | |
| 753 | |
| 754 base::string16 ModuleEnumerator::GetSubjectNameFromDigitalSignature( | 576 base::string16 ModuleEnumerator::GetSubjectNameFromDigitalSignature( |
| 755 const base::FilePath& filename) { | 577 const base::FilePath& filename) { |
| 756 HCERTSTORE store = NULL; | 578 // Try using the signature directly present in the file first. |
| 757 HCRYPTMSG message = NULL; | 579 base::string16 subject_name = GetSubjectNameInFile(filename); |
| 580 if (!subject_name.empty()) | |
| 581 return subject_name; | |
| 758 | 582 |
| 759 // Find the crypto message for this filename. | 583 // If that fails then look in the signed catalogs. |
| 760 bool result = !!CryptQueryObject(CERT_QUERY_OBJECT_FILE, | 584 return GetSubjectNameInCatalog(filename); |
| 761 filename.value().c_str(), | 585 } |
| 762 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, | |
| 763 CERT_QUERY_FORMAT_FLAG_BINARY, | |
| 764 0, | |
| 765 NULL, | |
| 766 NULL, | |
| 767 NULL, | |
| 768 &store, | |
| 769 &message, | |
| 770 NULL); | |
| 771 if (!result) | |
| 772 return base::string16(); | |
| 773 | 586 |
| 774 // Determine the size of the signer info data. | 587 void ModuleEnumerator::ReportThirdPartyMetrics() { |
| 775 DWORD signer_info_size = 0; | 588 size_t signed_modules = 0; |
| 776 result = !!CryptMsgGetParam(message, | 589 size_t microsoft_modules = 0; |
| 777 CMSG_SIGNER_INFO_PARAM, | 590 for (const auto& module : *enumerated_modules_) { |
| 778 0, | 591 if (!module.digital_signer.empty()) { |
| 779 NULL, | 592 ++signed_modules; |
| 780 &signer_info_size); | 593 if (module.digital_signer.find(L"Microsoft") != base::string16::npos) |
|
Lei Zhang
2016/08/04 14:33:32
Would you be looking for strings that start with M
chrisha
2016/08/12 19:04:41
Yeah, starting with Microsoft is fine. Fixed.
| |
| 781 if (!result) | 594 ++microsoft_modules; |
| 782 return base::string16(); | 595 } |
| 783 | |
| 784 // Allocate enough space to hold the signer info. | |
| 785 std::unique_ptr<BYTE[]> signer_info_buffer(new BYTE[signer_info_size]); | |
| 786 CMSG_SIGNER_INFO* signer_info = | |
| 787 reinterpret_cast<CMSG_SIGNER_INFO*>(signer_info_buffer.get()); | |
| 788 | |
| 789 // Obtain the signer info. | |
| 790 result = !!CryptMsgGetParam(message, | |
| 791 CMSG_SIGNER_INFO_PARAM, | |
| 792 0, | |
| 793 signer_info, | |
| 794 &signer_info_size); | |
| 795 if (!result) | |
| 796 return base::string16(); | |
| 797 | |
| 798 // Search for the signer certificate. | |
| 799 CERT_INFO CertInfo = {0}; | |
| 800 PCCERT_CONTEXT cert_context = NULL; | |
| 801 CertInfo.Issuer = signer_info->Issuer; | |
| 802 CertInfo.SerialNumber = signer_info->SerialNumber; | |
| 803 | |
| 804 cert_context = CertFindCertificateInStore( | |
| 805 store, | |
| 806 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, | |
| 807 0, | |
| 808 CERT_FIND_SUBJECT_CERT, | |
| 809 &CertInfo, | |
| 810 NULL); | |
| 811 if (!cert_context) | |
| 812 return base::string16(); | |
| 813 | |
| 814 // Determine the size of the Subject name. | |
| 815 DWORD subject_name_size = CertGetNameString( | |
| 816 cert_context, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL, NULL, 0); | |
| 817 if (!subject_name_size) | |
| 818 return base::string16(); | |
| 819 | |
| 820 base::string16 subject_name; | |
| 821 subject_name.resize(subject_name_size); | |
| 822 | |
| 823 // Get subject name. | |
| 824 if (!(CertGetNameString(cert_context, | |
| 825 CERT_NAME_SIMPLE_DISPLAY_TYPE, | |
| 826 0, | |
| 827 NULL, | |
| 828 const_cast<LPWSTR>(subject_name.c_str()), | |
| 829 subject_name_size))) { | |
| 830 return base::string16(); | |
| 831 } | 596 } |
| 832 | 597 |
| 833 return subject_name; | 598 // Report back some metrics regarding third party modules. |
| 599 UMA_HISTOGRAM_CUSTOM_COUNTS("ThirdPartyModules.Modules.Signed", | |
| 600 signed_modules, 1, 500, 50); | |
| 601 UMA_HISTOGRAM_CUSTOM_COUNTS("ThirdPartyModules.Modules.Signed.Microsoft", | |
| 602 microsoft_modules, 1, 500, 50); | |
| 603 UMA_HISTOGRAM_CUSTOM_COUNTS("ThirdPartyModules.Modules.Total", | |
| 604 enumerated_modules_->size(), 1, 500, 50); | |
| 834 } | 605 } |
| 835 | 606 |
| 836 // ---------------------------------------------------------------------------- | 607 // ---------------------------------------------------------------------------- |
| 837 | 608 |
| 838 // static | 609 // static |
| 839 EnumerateModulesModel* EnumerateModulesModel::GetInstance() { | 610 EnumerateModulesModel* EnumerateModulesModel::GetInstance() { |
| 840 return base::Singleton<EnumerateModulesModel>::get(); | 611 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 612 static EnumerateModulesModel* model = nullptr; | |
| 613 if (!model) { | |
| 614 model = new EnumerateModulesModel(); | |
| 615 ANNOTATE_LEAKING_OBJECT_PTR(model); | |
|
Lei Zhang
2016/08/04 14:33:32
Use a LazyInstance?
chrisha
2016/08/12 19:04:41
LazyInstance is thread safe, which is a stronger g
| |
| 616 } | |
| 617 return model; | |
| 618 } | |
| 619 | |
| 620 void EnumerateModulesModel::AddObserver(Observer* observer) { | |
| 621 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 622 observers_.AddObserver(observer); | |
| 623 } | |
| 624 | |
| 625 // Removes an |observer| from the enumerator. May only be called from the UI | |
| 626 // thread and callbacks will also occur on the UI thread. | |
| 627 void EnumerateModulesModel::RemoveObserver(Observer* observer) { | |
| 628 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 629 observers_.RemoveObserver(observer); | |
| 841 } | 630 } |
| 842 | 631 |
| 843 bool EnumerateModulesModel::ShouldShowConflictWarning() const { | 632 bool EnumerateModulesModel::ShouldShowConflictWarning() const { |
| 633 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 634 | |
| 844 // If the user has acknowledged the conflict notification, then we don't need | 635 // If the user has acknowledged the conflict notification, then we don't need |
| 845 // to show it again (because the scanning only happens once per the lifetime | 636 // to show it again (because the scanning only happens once per the lifetime |
| 846 // of the process). If we were to run the scanning more than once, then we'd | 637 // of the process). If we were to run the scanning more than once, then we'd |
| 847 // need to clear the flag somewhere when we are ready to show it again. | 638 // need to clear the flag somewhere when we are ready to show it again. |
| 848 if (conflict_notification_acknowledged_) | 639 if (conflict_notification_acknowledged_) |
| 849 return false; | 640 return false; |
| 850 | 641 |
| 851 return confirmed_bad_modules_detected_ > 0; | 642 return confirmed_bad_modules_detected_ > 0; |
| 852 } | 643 } |
| 853 | 644 |
| 854 void EnumerateModulesModel::AcknowledgeConflictNotification() { | 645 void EnumerateModulesModel::AcknowledgeConflictNotification() { |
| 646 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 647 | |
| 855 if (!conflict_notification_acknowledged_) { | 648 if (!conflict_notification_acknowledged_) { |
| 856 conflict_notification_acknowledged_ = true; | 649 conflict_notification_acknowledged_ = true; |
| 857 content::NotificationService::current()->Notify( | 650 FOR_EACH_OBSERVER(Observer, observers_, OnConflictsAcknowledged()); |
| 858 chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE, | 651 } |
| 859 content::Source<EnumerateModulesModel>(this), | 652 } |
| 860 content::NotificationService::NoDetails()); | 653 |
| 654 int EnumerateModulesModel::suspected_bad_modules_detected() const { | |
| 655 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 656 return suspected_bad_modules_detected_; | |
| 657 } | |
| 658 | |
| 659 // Returns the number of confirmed bad modules found in the last scan. | |
| 660 // Returns 0 if no scan has taken place yet. | |
| 661 int EnumerateModulesModel::confirmed_bad_modules_detected() const { | |
| 662 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 663 return confirmed_bad_modules_detected_; | |
| 664 } | |
| 665 | |
| 666 // Returns how many modules to notify the user about. | |
| 667 int EnumerateModulesModel::modules_to_notify_about() const { | |
| 668 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 669 return modules_to_notify_about_; | |
| 670 } | |
| 671 | |
| 672 void EnumerateModulesModel::MaybePostScanningTask() { | |
| 673 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 674 static bool done = false; | |
| 675 if (!done) { | |
| 676 BrowserThread::PostAfterStartupTask( | |
| 677 FROM_HERE, | |
| 678 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | |
| 679 base::Bind(&EnumerateModulesModel::ScanNow, base::Unretained(this))); | |
| 680 done = true; | |
| 861 } | 681 } |
| 862 } | 682 } |
| 863 | 683 |
| 864 void EnumerateModulesModel::ScanNow() { | 684 void EnumerateModulesModel::ScanNow() { |
| 865 if (scanning_) | 685 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 866 return; // A scan is already in progress. | |
| 867 | 686 |
| 868 lock->Acquire(); // Balanced in DoneScanning(); | 687 // If a module enumerator exists then a scan is already underway. |
| 688 if (module_enumerator_.get()) | |
|
Lei Zhang
2016/08/04 14:33:32
You can omit the .get()
chrisha
2016/08/12 19:04:40
Done.
| |
| 689 return; | |
| 869 | 690 |
| 870 scanning_ = true; | 691 // ScanNow does not block, rather it simply schedules a task. |
| 871 | 692 module_enumerator_.reset(new ModuleEnumerator(this)); |
| 872 // Instruct the ModuleEnumerator class to load this on the File thread. | 693 module_enumerator_->ScanNow(&enumerated_modules_); |
| 873 // ScanNow does not block. | |
| 874 if (!module_enumerator_.get()) | |
| 875 module_enumerator_ = new ModuleEnumerator(this); | |
| 876 module_enumerator_->ScanNow(&enumerated_modules_, limited_mode_); | |
| 877 } | 694 } |
| 878 | 695 |
| 879 base::ListValue* EnumerateModulesModel::GetModuleList() const { | 696 base::ListValue* EnumerateModulesModel::GetModuleList() { |
| 880 if (scanning_) | 697 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 881 return NULL; | |
| 882 | 698 |
| 883 lock->Acquire(); | 699 // If a |module_enumerator_| is still around then scanning has not yet |
| 700 // completed, and it is unsafe to read from |enumerated_modules_|. | |
| 701 if (module_enumerator_.get()) | |
| 702 return nullptr; | |
| 884 | 703 |
| 885 if (enumerated_modules_.empty()) { | 704 if (enumerated_modules_.empty()) |
| 886 lock->Release(); | 705 return nullptr; |
| 887 return NULL; | |
| 888 } | |
| 889 | 706 |
| 890 base::ListValue* list = new base::ListValue(); | 707 base::ListValue* list = new base::ListValue(); |
| 891 | 708 |
| 892 for (ModuleEnumerator::ModulesVector::const_iterator module = | 709 for (ModuleEnumerator::ModulesVector::const_iterator module = |
|
Lei Zhang
2016/08/04 14:33:32
It would be nice to eventually switch to a range-b
chrisha
2016/08/12 19:04:41
Acknowledged.
| |
| 893 enumerated_modules_.begin(); | 710 enumerated_modules_.begin(); |
| 894 module != enumerated_modules_.end(); ++module) { | 711 module != enumerated_modules_.end(); ++module) { |
| 895 base::DictionaryValue* data = new base::DictionaryValue(); | 712 base::DictionaryValue* data = new base::DictionaryValue(); |
| 896 data->SetInteger("type", module->type); | 713 data->SetInteger("type", module->type); |
| 897 base::string16 type_string; | 714 base::string16 type_string; |
| 898 if ((module->type & ModuleEnumerator::LOADED_MODULE) == 0) { | 715 if ((module->type & ModuleEnumerator::LOADED_MODULE) == 0) { |
| 899 // Module is not loaded, denote type of module. | 716 // Module is not loaded, denote type of module. |
| 900 if (module->type & ModuleEnumerator::SHELL_EXTENSION) | 717 if (module->type & ModuleEnumerator::SHELL_EXTENSION) |
| 901 type_string = L"Shell Extension"; | 718 type_string = L"Shell Extension"; |
| 902 if (module->type & ModuleEnumerator::WINSOCK_MODULE_REGISTRATION) { | 719 if (module->type & ModuleEnumerator::WINSOCK_MODULE_REGISTRATION) { |
| 903 if (!type_string.empty()) | 720 if (!type_string.empty()) |
| 904 type_string += L", "; | 721 type_string += L", "; |
| 905 type_string += L"Winsock"; | 722 type_string += L"Winsock"; |
| 906 } | 723 } |
| 907 // Must be one of the above type. | 724 // Must be one of the above type. |
| 908 DCHECK(!type_string.empty()); | 725 DCHECK(!type_string.empty()); |
| 909 if (!limited_mode_) { | 726 type_string += L" -- "; |
| 910 type_string += L" -- "; | 727 type_string += l10n_util::GetStringUTF16(IDS_CONFLICTS_NOT_LOADED_YET); |
| 911 type_string += l10n_util::GetStringUTF16(IDS_CONFLICTS_NOT_LOADED_YET); | |
| 912 } | |
| 913 } | 728 } |
| 914 data->SetString("type_description", type_string); | 729 data->SetString("type_description", type_string); |
| 915 data->SetInteger("status", module->status); | 730 data->SetInteger("status", module->status); |
| 916 data->SetString("location", module->location); | 731 data->SetString("location", module->location); |
| 917 data->SetString("name", module->name); | 732 data->SetString("name", module->name); |
| 918 data->SetString("product_name", module->product_name); | 733 data->SetString("product_name", module->product_name); |
| 919 data->SetString("description", module->description); | 734 data->SetString("description", module->description); |
| 920 data->SetString("version", module->version); | 735 data->SetString("version", module->version); |
| 921 data->SetString("digital_signer", module->digital_signer); | 736 data->SetString("digital_signer", module->digital_signer); |
| 922 | 737 |
| 923 if (!limited_mode_) { | 738 // Figure out the possible resolution help string. |
| 924 // Figure out the possible resolution help string. | 739 base::string16 actions; |
| 925 base::string16 actions; | 740 base::string16 separator = L" " + |
| 926 base::string16 separator = L" " + | 741 l10n_util::GetStringUTF16( |
| 927 l10n_util::GetStringUTF16( | 742 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_SEPARATOR) + |
| 928 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_SEPARATOR) + | 743 L" "; |
| 929 L" "; | |
| 930 | 744 |
| 931 if (module->recommended_action & ModuleEnumerator::INVESTIGATING) { | 745 if (module->recommended_action & ModuleEnumerator::INVESTIGATING) { |
| 746 actions = l10n_util::GetStringUTF16( | |
| 747 IDS_CONFLICTS_CHECK_INVESTIGATING); | |
| 748 } else { | |
| 749 if (module->recommended_action & ModuleEnumerator::UNINSTALL) { | |
| 750 if (!actions.empty()) | |
|
Lei Zhang
2016/08/04 14:33:32
Is this ever true?
chrisha
2016/08/12 19:04:41
Nope, indeed it can't be. Fixed.
| |
| 751 actions += separator; | |
| 932 actions = l10n_util::GetStringUTF16( | 752 actions = l10n_util::GetStringUTF16( |
| 933 IDS_CONFLICTS_CHECK_INVESTIGATING); | 753 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UNINSTALL); |
| 934 } else { | |
| 935 if (module->recommended_action & ModuleEnumerator::UNINSTALL) { | |
| 936 if (!actions.empty()) | |
| 937 actions += separator; | |
| 938 actions = l10n_util::GetStringUTF16( | |
| 939 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UNINSTALL); | |
| 940 } | |
| 941 if (module->recommended_action & ModuleEnumerator::UPDATE) { | |
| 942 if (!actions.empty()) | |
| 943 actions += separator; | |
| 944 actions += l10n_util::GetStringUTF16( | |
| 945 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UPDATE); | |
| 946 } | |
| 947 if (module->recommended_action & ModuleEnumerator::DISABLE) { | |
| 948 if (!actions.empty()) | |
| 949 actions += separator; | |
| 950 actions += l10n_util::GetStringUTF16( | |
| 951 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_DISABLE); | |
| 952 } | |
| 953 } | 754 } |
| 954 base::string16 possible_resolution; | 755 if (module->recommended_action & ModuleEnumerator::UPDATE) { |
| 955 if (!actions.empty()) { | 756 if (!actions.empty()) |
| 956 possible_resolution = | 757 actions += separator; |
| 957 l10n_util::GetStringUTF16(IDS_CONFLICTS_CHECK_POSSIBLE_ACTIONS) + | 758 actions += l10n_util::GetStringUTF16( |
| 958 L" " + actions; | 759 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UPDATE); |
| 959 } | 760 } |
| 960 data->SetString("possibleResolution", possible_resolution); | 761 if (module->recommended_action & ModuleEnumerator::DISABLE) { |
| 961 data->SetString("help_url", | 762 if (!actions.empty()) |
| 962 ConstructHelpCenterUrl(*module).spec().c_str()); | 763 actions += separator; |
| 764 actions += l10n_util::GetStringUTF16( | |
| 765 IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_DISABLE); | |
| 766 } | |
| 963 } | 767 } |
| 768 base::string16 possible_resolution; | |
| 769 if (!actions.empty()) { | |
| 770 possible_resolution = | |
| 771 l10n_util::GetStringUTF16(IDS_CONFLICTS_CHECK_POSSIBLE_ACTIONS) + | |
| 772 L" " + actions; | |
| 773 } | |
| 774 data->SetString("possibleResolution", possible_resolution); | |
| 775 // TODO(chrisha): Set help_url when we have a meaningful place for users | |
| 776 // to land. | |
| 964 | 777 |
| 965 list->Append(data); | 778 list->Append(data); |
| 966 } | 779 } |
| 967 | 780 |
| 968 lock->Release(); | |
| 969 return list; | 781 return list; |
| 970 } | 782 } |
| 971 | 783 |
| 972 GURL EnumerateModulesModel::GetFirstNotableConflict() { | 784 GURL EnumerateModulesModel::GetConflictUrl() { |
| 973 lock->Acquire(); | 785 // For now, simply bring up the chrome://conflicts page, which has detailed |
| 974 GURL url; | 786 // information about each module. |
| 975 | 787 if (ShouldShowConflictWarning()) |
| 976 if (enumerated_modules_.empty()) { | 788 return GURL(L"chrome://conflicts"); |
| 977 lock->Release(); | 789 return GURL(); |
| 978 return GURL(); | |
| 979 } | |
| 980 | |
| 981 for (ModuleEnumerator::ModulesVector::const_iterator module = | |
| 982 enumerated_modules_.begin(); | |
| 983 module != enumerated_modules_.end(); ++module) { | |
| 984 if (!(module->recommended_action & ModuleEnumerator::NOTIFY_USER)) | |
| 985 continue; | |
| 986 | |
| 987 url = ConstructHelpCenterUrl(*module); | |
| 988 DCHECK(url.is_valid()); | |
| 989 break; | |
| 990 } | |
| 991 | |
| 992 lock->Release(); | |
| 993 return url; | |
| 994 } | 790 } |
| 995 | 791 |
| 996 EnumerateModulesModel::EnumerateModulesModel() | 792 EnumerateModulesModel::EnumerateModulesModel() |
| 997 : limited_mode_(false), | 793 : conflict_notification_acknowledged_(false), |
| 998 scanning_(false), | |
| 999 conflict_notification_acknowledged_(false), | |
| 1000 confirmed_bad_modules_detected_(0), | 794 confirmed_bad_modules_detected_(0), |
| 1001 modules_to_notify_about_(0), | 795 modules_to_notify_about_(0), |
| 1002 suspected_bad_modules_detected_(0) { | 796 suspected_bad_modules_detected_(0) { |
| 1003 lock = new base::Lock(); | |
| 1004 } | 797 } |
| 1005 | 798 |
| 1006 EnumerateModulesModel::~EnumerateModulesModel() { | 799 EnumerateModulesModel::~EnumerateModulesModel() { |
| 1007 delete lock; | |
| 1008 } | |
| 1009 | |
| 1010 void EnumerateModulesModel::MaybePostScanningTask() { | |
| 1011 static bool done = false; | |
| 1012 if (!done) { | |
| 1013 done = true; | |
| 1014 if (base::win::GetVersion() == base::win::VERSION_XP) { | |
| 1015 check_modules_timer_.Start(FROM_HERE, | |
| 1016 base::TimeDelta::FromMilliseconds(kModuleCheckDelayMs), | |
| 1017 this, &EnumerateModulesModel::ScanNow); | |
| 1018 } | |
| 1019 } | |
| 1020 } | 800 } |
| 1021 | 801 |
| 1022 void EnumerateModulesModel::DoneScanning() { | 802 void EnumerateModulesModel::DoneScanning() { |
| 803 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 804 DCHECK(module_enumerator_.get()); | |
| 805 | |
| 1023 confirmed_bad_modules_detected_ = 0; | 806 confirmed_bad_modules_detected_ = 0; |
| 1024 suspected_bad_modules_detected_ = 0; | 807 suspected_bad_modules_detected_ = 0; |
| 1025 modules_to_notify_about_ = 0; | 808 modules_to_notify_about_ = 0; |
| 1026 for (ModuleEnumerator::ModulesVector::const_iterator module = | 809 for (ModuleEnumerator::ModulesVector::const_iterator module = |
| 1027 enumerated_modules_.begin(); | 810 enumerated_modules_.begin(); |
| 1028 module != enumerated_modules_.end(); ++module) { | 811 module != enumerated_modules_.end(); ++module) { |
| 1029 if (module->status == ModuleEnumerator::CONFIRMED_BAD) { | 812 if (module->status == ModuleEnumerator::CONFIRMED_BAD) { |
| 1030 ++confirmed_bad_modules_detected_; | 813 ++confirmed_bad_modules_detected_; |
| 1031 if (module->recommended_action & ModuleEnumerator::NOTIFY_USER) | 814 if (module->recommended_action & ModuleEnumerator::NOTIFY_USER) |
| 1032 ++modules_to_notify_about_; | 815 ++modules_to_notify_about_; |
| 1033 } else if (module->status == ModuleEnumerator::SUSPECTED_BAD) { | 816 } else if (module->status == ModuleEnumerator::SUSPECTED_BAD) { |
| 1034 ++suspected_bad_modules_detected_; | 817 ++suspected_bad_modules_detected_; |
| 1035 if (module->recommended_action & ModuleEnumerator::NOTIFY_USER) | 818 if (module->recommended_action & ModuleEnumerator::NOTIFY_USER) |
| 1036 ++modules_to_notify_about_; | 819 ++modules_to_notify_about_; |
| 1037 } | 820 } |
| 1038 } | 821 } |
| 1039 | 822 |
| 1040 scanning_ = false; | 823 module_enumerator_.reset(); |
| 1041 lock->Release(); | |
| 1042 | 824 |
| 1043 UMA_HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules", | 825 UMA_HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules", |
| 1044 suspected_bad_modules_detected_); | 826 suspected_bad_modules_detected_); |
| 1045 UMA_HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules", | 827 UMA_HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules", |
| 1046 confirmed_bad_modules_detected_); | 828 confirmed_bad_modules_detected_); |
| 1047 | 829 |
| 1048 // Notifications are not available in limited mode. | 830 // Forward the callback to any registered observers. |
| 1049 if (limited_mode_) | 831 FOR_EACH_OBSERVER(Observer, observers_, OnScanCompleted()); |
| 1050 return; | |
| 1051 | |
| 1052 content::NotificationService::current()->Notify( | |
| 1053 chrome::NOTIFICATION_MODULE_LIST_ENUMERATED, | |
| 1054 content::Source<EnumerateModulesModel>(this), | |
| 1055 content::NotificationService::NoDetails()); | |
| 1056 } | 832 } |
| 1057 | |
| 1058 GURL EnumerateModulesModel::ConstructHelpCenterUrl( | |
| 1059 const ModuleEnumerator::Module& module) const { | |
| 1060 if (!(module.recommended_action & ModuleEnumerator::SEE_LINK) && | |
| 1061 !(module.recommended_action & ModuleEnumerator::NOTIFY_USER)) | |
| 1062 return GURL(); | |
| 1063 | |
| 1064 // Construct the needed hashes. | |
| 1065 std::string filename, location, description, signer; | |
| 1066 GenerateHash(base::WideToUTF8(module.name), &filename); | |
| 1067 GenerateHash(base::WideToUTF8(module.location), &location); | |
| 1068 GenerateHash(base::WideToUTF8(module.description), &description); | |
| 1069 GenerateHash(base::WideToUTF8(module.digital_signer), &signer); | |
| 1070 | |
| 1071 base::string16 url = | |
| 1072 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, | |
| 1073 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location), | |
| 1074 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer)); | |
| 1075 return GURL(base::UTF16ToUTF8(url)); | |
| 1076 } | |
| OLD | NEW |