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

Unified Diff: chrome/common/safe_browsing/pe_image_reader_win.h

Issue 1047693002: Give PeImageReader the power to read certificate entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to position 323578 Created 5 years, 9 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/common/safe_browsing/pe_image_reader_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/safe_browsing/pe_image_reader_win.h
diff --git a/chrome/common/safe_browsing/pe_image_reader_win.h b/chrome/common/safe_browsing/pe_image_reader_win.h
index 00761c5730c26d3cfc2660985ed5395b21d5c6d5..8d81f156d947f4c14a4d683bc6c11cc708c5b6f7 100644
--- a/chrome/common/safe_browsing/pe_image_reader_win.h
+++ b/chrome/common/safe_browsing/pe_image_reader_win.h
@@ -21,6 +21,18 @@ class PeImageReader {
WORD_SIZE_64,
};
+ // A callback invoked by EnumCertificates once for each attribute certificate
+ // entry in the image's attribute certificate table. |revision| and
+ // |certificate_type| identify the contents of |certificate_data| (which is of
+ // |certificate_data_size| bytes). |context| is the value provided by the
+ // caller to EnumCertificates(). Implementations must return true to continue
+ // the enumeration, or false to abort.
+ typedef bool (*EnumCertificatesCallback)(uint16_t revision,
+ uint16_t certificate_type,
+ const uint8_t* certificate_data,
+ size_t certificate_data_size,
+ void* context);
+
PeImageReader();
~PeImageReader();
@@ -47,6 +59,14 @@ class PeImageReader {
const uint8_t** raw_data,
size_t* raw_data_size);
+ // Invokes |callback| once per attribute certificate entry. |context| is a
+ // caller-specific value that is passed to |callback|. Returns true if all
+ // certificate entries are visited (even if there are no such entries) and
+ // |callback| returns true for each. Conversely, returns |false| if |callback|
+ // returns false or if the image is malformed in any way.
+ bool EnumCertificates(EnumCertificatesCallback callback,
+ void* context);
+
private:
// Bits indicating what portions of the image have been validated.
enum ValidationStages {
« no previous file with comments | « no previous file | chrome/common/safe_browsing/pe_image_reader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698