OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
7 | 7 |
8 #include <inttypes.h> | 8 #include <inttypes.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // Closes both 'path' given to Open() and the kernel path. | 60 // Closes both 'path' given to Open() and the kernel path. |
61 int Close(); | 61 int Close(); |
62 | 62 |
63 // Verifies the downloaded payload against the signed hash included in the | 63 // Verifies the downloaded payload against the signed hash included in the |
64 // payload as well as against the update check hash and size and returns true | 64 // payload as well as against the update check hash and size and returns true |
65 // on success, false on failure. This method should be called after closing | 65 // on success, false on failure. This method should be called after closing |
66 // the stream. Note this method skips the signed hash check if the public key | 66 // the stream. Note this method skips the signed hash check if the public key |
67 // is unavailable; it returns false if the public key is available but the | 67 // is unavailable; it returns false if the public key is available but the |
68 // delta payload doesn't include a signature. If |public_key_path| is an empty | 68 // delta payload doesn't include a signature. If |public_key_path| is an empty |
69 // string, uses the default public key path. | 69 // string, uses the default public key path. |
70 // If the signature check fails, *signature_failed will be set to true (if | |
71 // it's non-NULL); this will not cause the method to fail. | |
petkov
2011/03/30 22:10:21
the code may segfault on NULL and failure...
adlr
2011/03/30 22:30:06
Fixed
| |
70 bool VerifyPayload(const std::string& public_key_path, | 72 bool VerifyPayload(const std::string& public_key_path, |
71 const std::string& update_check_response_hash, | 73 const std::string& update_check_response_hash, |
72 const uint64_t update_check_response_size); | 74 const uint64_t update_check_response_size, |
75 bool* signature_failed); | |
73 | 76 |
74 // Reads from the update manifest the expected sizes and hashes of the target | 77 // Reads from the update manifest the expected sizes and hashes of the target |
75 // kernel and rootfs partitions. These values can be used for applied update | 78 // kernel and rootfs partitions. These values can be used for applied update |
76 // hash verification. This method must be called after the update manifest has | 79 // hash verification. This method must be called after the update manifest has |
77 // been parsed (e.g., after closing the stream). Returns true on success, and | 80 // been parsed (e.g., after closing the stream). Returns true on success, and |
78 // false on failure (e.g., when the values are not present in the update | 81 // false on failure (e.g., when the values are not present in the update |
79 // manifest). | 82 // manifest). |
80 bool GetNewPartitionInfo(uint64_t* kernel_size, | 83 bool GetNewPartitionInfo(uint64_t* kernel_size, |
81 std::vector<char>* kernel_hash, | 84 std::vector<char>* kernel_hash, |
82 uint64_t* rootfs_size, | 85 uint64_t* rootfs_size, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 // verification. | 227 // verification. |
225 std::vector<char> current_kernel_hash_; | 228 std::vector<char> current_kernel_hash_; |
226 std::vector<char> current_rootfs_hash_; | 229 std::vector<char> current_rootfs_hash_; |
227 | 230 |
228 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); | 231 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); |
229 }; | 232 }; |
230 | 233 |
231 } // namespace chromeos_update_engine | 234 } // namespace chromeos_update_engine |
232 | 235 |
233 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 236 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
OLD | NEW |