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

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..af1008246b4263ddc86d524310642196b0e582da 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,35 @@ void CollectDllBlacklistData(
}
}
+void RecordModuleVerificationData(
+ const wchar_t* modules_to_verify[],
+ ClientIncidentReport_EnvironmentData_Process* process) {
+
+ for (int i = 0; modules_to_verify[i] != NULL; ++i) {
grt (UTC plus 2) 2014/08/05 16:04:54 i'm included to say int -> size_t here since the s
krstnmnlsn 2014/08/05 23:07:25 That is super neat.
+ std::set<std::string> modified_exports;
+ int modified =
+ safe_browsing::VerifyModule(modules_to_verify[i], &modified_exports);
grt (UTC plus 2) 2014/08/05 16:04:54 nit: omit "safe_browsing::"
krstnmnlsn 2014/08/05 23:07:25 Done.
+
+ ClientIncidentReport_EnvironmentData_Process_ModuleState* module_state =
+ process->add_module_state();
+
+ module_state->set_name(
+ base::WideToUTF8(std::wstring(modules_to_verify[i])));
+ module_state->set_modified_state(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(safe_browsing::modules_to_verify, process);
grt (UTC plus 2) 2014/08/05 16:04:54 nit: omit "safe_browsing::"
krstnmnlsn 2014/08/05 23:07:25 Done.
}
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698