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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h

Issue 1363613004: Implement anonymous, opt-in, collection of OS X binary integrity incidents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h
index 6ac4532aaae29578ce7cdc784a9de7e37fb7c0b9..018240413a9f7d092e048a7a57d5be2d49ecbf24 100644
--- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h
+++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h
@@ -5,18 +5,31 @@
#ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_BINARY_INTEGRITY_ANALYZER_H_
#define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_BINARY_INTEGRITY_ANALYZER_H_
+#include <string>
+#include <utility>
#include <vector>
+#include "base/files/file_util.h"
#include "base/memory/scoped_ptr.h"
namespace base {
-class FilePath;
+class TimeDelta;
} // namespace base
namespace safe_browsing {
class IncidentReceiver;
+#if defined(OS_MACOSX)
Robert Sesek 2015/10/20 22:57:27 Move this closer to where it's used by the functio
+// Wraps a path to a code object and its specified code requirement.
+struct PathAndRequirement {
+ PathAndRequirement(const base::FilePath& path, const std::string& requirement)
+ : path_(path), requirement_(requirement) { }
+ base::FilePath path_;
Robert Sesek 2015/10/20 22:57:27 nit: public struct members don't get trailing _
+ std::string requirement_;
+};
+#endif // defined(OS_MACOSX)
+
// Registers a process-wide analysis with the incident reporting service that
// will verify the signature of the most critical binaries used by Chrome. It
// will send an incident report every time a signature verification fails.
@@ -29,6 +42,22 @@ void VerifyBinaryIntegrity(scoped_ptr<IncidentReceiver> incident_receiver);
// Returns a vector containing the paths to all the binaries to verify.
std::vector<base::FilePath> GetCriticalBinariesPath();
+// Record how long the signature verification took.
+void RecordSignatureVerificationTime(size_t file_index,
+ const base::TimeDelta& verification_time);
+
+#if defined(OS_MACOSX)
+// Returns a vector of pairs, each of which contains the paths to the binaries
+// to verify, and the codesign requirement to use when verifying.
+std::vector<PathAndRequirement> GetCriticalPathsAndRequirements();
+
+// This is a helper stub to allow the signature checking code to be tested with
+// custom requirements and files.
+void VerifyBinaryIntegrityForTesting(IncidentReceiver* incident_receiver,
+ const base::FilePath& path,
+ const std::string& requirement);
+#endif // defined(OS_MACOSX)
+
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_BINARY_INTEGRITY_ANALYZER_H_
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698