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

Unified Diff: chrome/utility/safe_browsing/mac/dmg_analyzer.cc

Issue 2934373002: Record Code Signature of Downloaded DMG files (Closed)
Patch Set: adjusted test file path names Created 3 years, 6 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/utility/safe_browsing/mac/dmg_analyzer.cc
diff --git a/chrome/utility/safe_browsing/mac/dmg_analyzer.cc b/chrome/utility/safe_browsing/mac/dmg_analyzer.cc
index 09ebf17f7f483f5229d737a6eae57063acac8fd8..e1942aa5b2d05ec88b605989ab2b8df33cf67252 100644
--- a/chrome/utility/safe_browsing/mac/dmg_analyzer.cc
+++ b/chrome/utility/safe_browsing/mac/dmg_analyzer.cc
@@ -126,6 +126,11 @@ void AnalyzeDMGFile(base::File dmg_file, ArchiveAnalyzerResults* results) {
if (!iterator.Open())
return;
+ results->signature_blob.reserve(iterator.GetDmgSignatureLength());
+ std::copy(iterator.GetDmgSignatureData(),
+ iterator.GetDmgSignatureData() + iterator.GetDmgSignatureLength(),
+ std::back_inserter(results->signature_blob));
+
while (iterator.Next()) {
std::unique_ptr<ReadStream> stream = iterator.GetReadStream();
if (!stream || !feature_extractor.IsMachO(stream.get()))

Powered by Google App Engine
This is Rietveld 408576698