| 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 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 | 13 |
| 14 namespace base { |
| 14 class FilePath; | 15 class FilePath; |
| 16 } |
| 15 | 17 |
| 16 namespace safe_browsing { | 18 namespace safe_browsing { |
| 17 class ClientDownloadRequest_SignatureInfo; | 19 class ClientDownloadRequest_SignatureInfo; |
| 18 | 20 |
| 19 class SignatureUtil : public base::RefCountedThreadSafe<SignatureUtil> { | 21 class SignatureUtil : public base::RefCountedThreadSafe<SignatureUtil> { |
| 20 public: | 22 public: |
| 21 SignatureUtil(); | 23 SignatureUtil(); |
| 22 | 24 |
| 23 // Fills in the DownloadRequest_SignatureInfo for the given file path. | 25 // Fills in the DownloadRequest_SignatureInfo for the given file path. |
| 24 // This method may be called on any thread. | 26 // This method may be called on any thread. |
| 25 virtual void CheckSignature( | 27 virtual void CheckSignature( |
| 26 const FilePath& file_path, | 28 const base::FilePath& file_path, |
| 27 ClientDownloadRequest_SignatureInfo* signature_info); | 29 ClientDownloadRequest_SignatureInfo* signature_info); |
| 28 | 30 |
| 29 protected: | 31 protected: |
| 30 friend class base::RefCountedThreadSafe<SignatureUtil>; | 32 friend class base::RefCountedThreadSafe<SignatureUtil>; |
| 31 virtual ~SignatureUtil(); | 33 virtual ~SignatureUtil(); |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(SignatureUtil); | 36 DISALLOW_COPY_AND_ASSIGN(SignatureUtil); |
| 35 }; | 37 }; |
| 36 } // namespace safe_browsing | 38 } // namespace safe_browsing |
| 37 | 39 |
| 38 #endif // CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ | 40 #endif // CHROME_BROWSER_SAFE_BROWSING_SIGNATURE_UTIL_H_ |
| OLD | NEW |