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

Unified Diff: chrome/browser/win/enumerate_modules_model.h

Issue 2384413004: [Win] Count number of distinct certificates covering third party modules. (Closed)
Patch Set: Fix initializer lists. Created 4 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/win/enumerate_modules_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/enumerate_modules_model.h
diff --git a/chrome/browser/win/enumerate_modules_model.h b/chrome/browser/win/enumerate_modules_model.h
index da0bdbd67fea8fd3df988268e479cb5e6ffdc97d..5b3beac73a192659018ac600f5b962a267df06c1 100644
--- a/chrome/browser/win/enumerate_modules_model.h
+++ b/chrome/browser/win/enumerate_modules_model.h
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/observer_list.h"
@@ -20,7 +21,6 @@
class EnumerateModulesModel;
namespace base {
-class FilePath;
class ListValue;
}
@@ -73,10 +73,30 @@ class ModuleEnumerator {
XP = 1 << 0,
};
+ // The type of certificate found for the module.
+ enum CertificateType {
+ NO_CERTIFICATE,
+ CERTIFICATE_IN_FILE,
+ CERTIFICATE_IN_CATALOG,
+ };
+
+ // Information about the certificate of a file.
+ struct CertificateInfo {
+ CertificateInfo();
+
+ // The type of signature encountered.
+ CertificateType type;
+ // Path to the file containing the certificate. Empty if NO_CERTIFICATE.
+ base::FilePath path;
+ // The "Subject" name of the certificate.
+ base::string16 subject;
+ };
+
// The structure we populate when enumerating modules.
struct Module {
Module();
Module(const Module& rhs);
+ // Constructor exposed for unittesting.
Module(ModuleType type,
ModuleStatus status,
const base::string16& location,
@@ -84,7 +104,6 @@ class ModuleEnumerator {
const base::string16& product_name,
const base::string16& description,
const base::string16& version,
- const base::string16& digital_signer,
RecommendedAction recommended_action);
~Module();
@@ -102,8 +121,6 @@ class ModuleEnumerator {
base::string16 description;
// The module version.
base::string16 version;
- // The signer of the digital certificate for the module.
- base::string16 digital_signer;
// The help tips bitmask.
RecommendedAction recommended_action;
// The duplicate count within each category of modules.
@@ -111,6 +128,8 @@ class ModuleEnumerator {
// Whether this module has been normalized (necessary before checking it
// against blacklist).
bool normalized;
+ // The certificate info for the module.
+ CertificateInfo cert_info;
};
// A vector typedef of all modules enumerated.
@@ -182,11 +201,6 @@ class ModuleEnumerator {
// based on the |path_mapping_| vector.
void CollapsePath(Module* module);
- // Given a filename, returns the Subject (who signed it) retrieved from
- // the digital signature (Authenticode).
- base::string16 GetSubjectNameFromDigitalSignature(
- const base::FilePath& filename);
-
// Reports (via UMA) a handful of high-level metrics regarding third party
// modules in this process. Called by ScanImpl after modules have been
// enumerated and processed.
« no previous file with comments | « no previous file | chrome/browser/win/enumerate_modules_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698