| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/safe_browsing/signature_util.h" | |
| 6 | |
| 7 #include <windows.h> | |
| 8 #include <wincrypt.h> | |
| 9 #include "base/file_path.h" | |
| 10 | |
| 11 namespace safe_browsing { | |
| 12 namespace signature_util { | |
| 13 | |
| 14 bool IsSigned(const FilePath& file_path) { | |
| 15 // Get message handle and store handle from the signed file. | |
| 16 BOOL result = CryptQueryObject(CERT_QUERY_OBJECT_FILE, | |
| 17 file_path.value().c_str(), | |
| 18 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, | |
| 19 CERT_QUERY_FORMAT_FLAG_BINARY, | |
| 20 0, // flags | |
| 21 NULL, // encoding | |
| 22 NULL, // content type | |
| 23 NULL, // format type | |
| 24 NULL, // HCERTSTORE | |
| 25 NULL, // HCRYPTMSG | |
| 26 NULL); // context | |
| 27 return result == TRUE; | |
| 28 } | |
| 29 | |
| 30 } // namespace signature_util | |
| 31 } // namespace safe_browsing | |
| OLD | NEW |