Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: chrome/browser/safe_browsing/environment_data_collection_win.cc

Issue 440753002: The incident reporting service now calls VerifyModule. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/environment_data_collection_win.cc
diff --git a/chrome/browser/safe_browsing/environment_data_collection_win.cc b/chrome/browser/safe_browsing/environment_data_collection_win.cc
index 4872b5411f153d9873916d733b972709f342fdc8..75cac9a086eedd5e855fe96d11e932b39b2ee543 100644
--- a/chrome/browser/safe_browsing/environment_data_collection_win.cc
+++ b/chrome/browser/safe_browsing/environment_data_collection_win.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/install_verification/win/module_info.h"
#include "chrome/browser/install_verification/win/module_verification_common.h"
#include "chrome/browser/net/service_providers_win.h"
+#include "chrome/browser/safe_browsing/module_integrity_verifier_win.h"
#include "chrome/browser/safe_browsing/path_sanitizer.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome_elf/chrome_elf_constants.h"
@@ -102,11 +103,34 @@ void CollectDllBlacklistData(
}
}
+void RecordModuleVerificationData(
+ const wchar_t* const* modules_to_verify,
+ ClientIncidentReport_EnvironmentData_Process* process) {
+ for (; *modules_to_verify; ++modules_to_verify) {
+ std::set<std::string> modified_exports;
+ int modified = VerifyModule(*modules_to_verify, &modified_exports);
+
+ ClientIncidentReport_EnvironmentData_Process_ModuleState* module_state =
+ process->add_module_state();
+
+ module_state->set_name(base::WideToUTF8(std::wstring(*modules_to_verify)));
+ module_state->set_modified_state(
+ static_cast<ClientIncidentReport_EnvironmentData_Process_ModifiedState>(
+ modified));
+ for (std::set<std::string>::iterator it = modified_exports.begin();
+ it != modified_exports.end();
+ ++it) {
+ module_state->add_modified_export(*it);
+ }
+ }
+}
+
void CollectPlatformProcessData(
ClientIncidentReport_EnvironmentData_Process* process) {
CollectDlls(process);
RecordLspFeature(process);
CollectDllBlacklistData(process);
+ RecordModuleVerificationData(modules_to_verify, process);
grt (UTC plus 2) 2014/08/06 01:28:10 i think it makes sense to put: const wchar_t* cons
grt (UTC plus 2) 2014/08/06 01:28:10 nit: Collect rather than Record. "LspFeature" is a
krstnmnlsn 2014/08/06 21:55:11 Done.
krstnmnlsn 2014/08/06 21:55:11 Done.
}
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698