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

Side by Side Diff: chrome/browser/safe_browsing/signature_util_win.cc

Issue 10832293: Fixing a crash when loading themes on Win8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/signature_util.h" 5 #include "chrome/browser/safe_browsing/signature_util.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/file_path.h" 11 #include "base/file_path.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "chrome/common/safe_browsing/csd.pb.h" 13 #include "chrome/common/safe_browsing/csd.pb.h"
14 14
15 #pragma comment(lib, "wintrust.lib") 15 #pragma comment(lib, "wintrust.lib")
16 16
17 namespace safe_browsing { 17 namespace safe_browsing {
18 18
19 SignatureUtil::SignatureUtil() {} 19 SignatureUtil::SignatureUtil() {}
20 20
21 SignatureUtil::~SignatureUtil() {} 21 SignatureUtil::~SignatureUtil() {}
22 22
23 void SignatureUtil::CheckSignature( 23 void SignatureUtil::CheckSignature(
24 const FilePath& file_path, 24 const FilePath& file_path,
25 ClientDownloadRequest_SignatureInfo* signature_info) { 25 ClientDownloadRequest_SignatureInfo* signature_info) {
26 VLOG(2) << "Checking signature for " << file_path.value(); 26 VLOG(2) << "Checking signature for " << file_path.value();
27 27
28 WINTRUST_FILE_INFO file_info; 28 WINTRUST_FILE_INFO file_info = {0};
29 file_info.cbStruct = sizeof(file_info); 29 file_info.cbStruct = sizeof(file_info);
30 file_info.pcwszFilePath = file_path.value().c_str(); 30 file_info.pcwszFilePath = file_path.value().c_str();
31 file_info.hFile = NULL; 31 file_info.hFile = NULL;
32 file_info.pgKnownSubject = NULL; 32 file_info.pgKnownSubject = NULL;
33 33
34 WINTRUST_DATA wintrust_data; 34 WINTRUST_DATA wintrust_data = {0};
35 wintrust_data.cbStruct = sizeof(wintrust_data); 35 wintrust_data.cbStruct = sizeof(wintrust_data);
36 wintrust_data.pPolicyCallbackData = NULL; 36 wintrust_data.pPolicyCallbackData = NULL;
37 wintrust_data.pSIPClientData = NULL; 37 wintrust_data.pSIPClientData = NULL;
38 wintrust_data.dwUIChoice = WTD_UI_NONE; 38 wintrust_data.dwUIChoice = WTD_UI_NONE;
39 wintrust_data.fdwRevocationChecks = WTD_REVOKE_NONE; 39 wintrust_data.fdwRevocationChecks = WTD_REVOKE_NONE;
40 wintrust_data.dwUnionChoice = WTD_CHOICE_FILE; 40 wintrust_data.dwUnionChoice = WTD_CHOICE_FILE;
41 wintrust_data.pFile = &file_info; 41 wintrust_data.pFile = &file_info;
42 wintrust_data.dwStateAction = WTD_STATEACTION_VERIFY; 42 wintrust_data.dwStateAction = WTD_STATEACTION_VERIFY;
43 wintrust_data.hWVTStateData = NULL; 43 wintrust_data.hWVTStateData = NULL;
44 wintrust_data.pwszURLReference = NULL; 44 wintrust_data.pwszURLReference = NULL;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 // Free the provider data. 84 // Free the provider data.
85 wintrust_data.dwStateAction = WTD_STATEACTION_CLOSE; 85 wintrust_data.dwStateAction = WTD_STATEACTION_CLOSE;
86 WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE), 86 WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE),
87 &policy_guid, &wintrust_data); 87 &policy_guid, &wintrust_data);
88 } 88 }
89 } 89 }
90 90
91 } // namespace safe_browsing 91 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698