OLD | NEW |
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 // Utility functions to check executable signatures for malicious binary | 5 // Utility functions to check executable signatures for malicious binary |
6 // detection. Each platform has its own implementation of this class. | 6 // detection. Each platform has its own implementation of this class. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ |
10 #pragma once | |
11 | 10 |
12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
14 | 13 |
15 class FilePath; | 14 class FilePath; |
16 | 15 |
17 namespace safe_browsing { | 16 namespace safe_browsing { |
18 class ClientDownloadRequest_SignatureInfo; | 17 class ClientDownloadRequest_SignatureInfo; |
19 | 18 |
20 class SignatureUtil : public base::RefCountedThreadSafe<SignatureUtil> { | 19 class SignatureUtil : public base::RefCountedThreadSafe<SignatureUtil> { |
21 public: | 20 public: |
22 SignatureUtil(); | 21 SignatureUtil(); |
23 | 22 |
24 // Fills in the DownloadRequest_SignatureInfo for the given file path. | 23 // Fills in the DownloadRequest_SignatureInfo for the given file path. |
25 // This method may be called on any thread. | 24 // This method may be called on any thread. |
26 virtual void CheckSignature( | 25 virtual void CheckSignature( |
27 const FilePath& file_path, | 26 const FilePath& file_path, |
28 ClientDownloadRequest_SignatureInfo* signature_info); | 27 ClientDownloadRequest_SignatureInfo* signature_info); |
29 | 28 |
30 protected: | 29 protected: |
31 friend class base::RefCountedThreadSafe<SignatureUtil>; | 30 friend class base::RefCountedThreadSafe<SignatureUtil>; |
32 virtual ~SignatureUtil(); | 31 virtual ~SignatureUtil(); |
33 | 32 |
34 private: | 33 private: |
35 DISALLOW_COPY_AND_ASSIGN(SignatureUtil); | 34 DISALLOW_COPY_AND_ASSIGN(SignatureUtil); |
36 }; | 35 }; |
37 } // namespace safe_browsing | 36 } // namespace safe_browsing |
38 | 37 |
39 #endif // CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ | 38 #endif // CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ |
OLD | NEW |