OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/safe_browsing/binary_feature_extractor.h" | 5 #include "chrome/browser/safe_browsing/binary_feature_extractor.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <softpub.h> | 8 #include <softpub.h> |
9 #include <wintrust.h> | 9 #include <wintrust.h> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/memory_mapped_file.h" | 12 #include "base/files/memory_mapped_file.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "chrome/browser/safe_browsing/pe_image_reader_win.h" | 14 #include "chrome/browser/safe_browsing/pe_image_reader_win.h" |
15 #include "chrome/common/safe_browsing/csd.pb.h" | 15 #include "chrome/common/safe_browsing/csd.pb.h" |
16 | 16 |
17 #pragma comment(lib, "wintrust.lib") | 17 #pragma comment(lib, "wintrust.lib") |
18 | 18 |
19 namespace safe_browsing { | 19 namespace safe_browsing { |
20 | 20 |
21 BinaryFeatureExtractor::BinaryFeatureExtractor() {} | 21 BinaryFeatureExtractor::BinaryFeatureExtractor() {} |
22 | 22 |
23 BinaryFeatureExtractor::~BinaryFeatureExtractor() {} | 23 BinaryFeatureExtractor::~BinaryFeatureExtractor() {} |
24 | 24 |
25 void BinaryFeatureExtractor::CheckSignature( | 25 void BinaryFeatureExtractor::CheckSignature( |
26 const base::FilePath& file_path, | 26 const base::FilePath& file_path, |
27 ClientDownloadRequest_SignatureInfo* signature_info) { | 27 ClientDownloadRequest_SignatureInfo* signature_info) { |
28 VLOG(2) << "Checking signature for " << file_path.value(); | 28 DVLOG(2) << "Checking signature for " << file_path.value(); |
29 | 29 |
30 WINTRUST_FILE_INFO file_info = {0}; | 30 WINTRUST_FILE_INFO file_info = {0}; |
31 file_info.cbStruct = sizeof(file_info); | 31 file_info.cbStruct = sizeof(file_info); |
32 file_info.pcwszFilePath = file_path.value().c_str(); | 32 file_info.pcwszFilePath = file_path.value().c_str(); |
33 file_info.hFile = NULL; | 33 file_info.hFile = NULL; |
34 file_info.pgKnownSubject = NULL; | 34 file_info.pgKnownSubject = NULL; |
35 | 35 |
36 WINTRUST_DATA wintrust_data = {0}; | 36 WINTRUST_DATA wintrust_data = {0}; |
37 wintrust_data.cbStruct = sizeof(wintrust_data); | 37 wintrust_data.cbStruct = sizeof(wintrust_data); |
38 wintrust_data.pPolicyCallbackData = NULL; | 38 wintrust_data.pPolicyCallbackData = NULL; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 pe_headers->add_debug_data(); | 138 pe_headers->add_debug_data(); |
139 debug_data->set_directory_entry(directory_entry, | 139 debug_data->set_directory_entry(directory_entry, |
140 sizeof(*directory_entry)); | 140 sizeof(*directory_entry)); |
141 if (raw_data) | 141 if (raw_data) |
142 debug_data->set_raw_data(raw_data, raw_data_size); | 142 debug_data->set_raw_data(raw_data, raw_data_size); |
143 } | 143 } |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 } // namespace safe_browsing | 147 } // namespace safe_browsing |
OLD | NEW |