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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // payload as well as against the update check hash and size and returns true | 56 // payload as well as against the update check hash and size and returns true |
57 // on success, false on failure. This method should be called after closing | 57 // on success, false on failure. This method should be called after closing |
58 // the stream. Note this method skips the signed hash check if the public key | 58 // the stream. Note this method skips the signed hash check if the public key |
59 // is unavailable; it returns false if the public key is available but the | 59 // is unavailable; it returns false if the public key is available but the |
60 // delta payload doesn't include a signature. If |public_key_path| is an empty | 60 // delta payload doesn't include a signature. If |public_key_path| is an empty |
61 // string, uses the default public key path. | 61 // string, uses the default public key path. |
62 bool VerifyPayload(const std::string& public_key_path, | 62 bool VerifyPayload(const std::string& public_key_path, |
63 const std::string& update_check_response_hash, | 63 const std::string& update_check_response_hash, |
64 const uint64_t update_check_response_size); | 64 const uint64_t update_check_response_size); |
65 | 65 |
| 66 // Verifies that the generated update is correct based on the hashes sent by |
| 67 // the server. Returns true on success, false otherwise. |
| 68 bool VerifyAppliedUpdate(const std::string& path, |
| 69 const std::string& kernel_path); |
| 70 |
66 // Converts an ordered collection of Extent objects which contain data of | 71 // Converts an ordered collection of Extent objects which contain data of |
67 // length full_length to a comma-separated string. For each Extent, the | 72 // length full_length to a comma-separated string. For each Extent, the |
68 // string will have the start offset and then the length in bytes. | 73 // string will have the start offset and then the length in bytes. |
69 // The length value of the last extent in the string may be short, since | 74 // The length value of the last extent in the string may be short, since |
70 // the full length of all extents in the string is capped to full_length. | 75 // the full length of all extents in the string is capped to full_length. |
71 // Also, an extent starting at kSparseHole, appears as -1 in the string. | 76 // Also, an extent starting at kSparseHole, appears as -1 in the string. |
72 // For example, if the Extents are {1, 1}, {4, 2}, {kSparseHole, 1}, | 77 // For example, if the Extents are {1, 1}, {4, 2}, {kSparseHole, 1}, |
73 // {0, 1}, block_size is 4096, and full_length is 5 * block_size - 13, | 78 // {0, 1}, block_size is 4096, and full_length is 5 * block_size - 13, |
74 // the resulting string will be: "4096:4096,16384:8192,-1:4096,0:4083" | 79 // the resulting string will be: "4096:4096,16384:8192,-1:4096,0:4083" |
75 static bool ExtentsToBsdiffPositionsString( | 80 static bool ExtentsToBsdiffPositionsString( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 180 |
176 // Signatures message blob extracted directly from the payload. | 181 // Signatures message blob extracted directly from the payload. |
177 std::vector<char> signatures_message_data_; | 182 std::vector<char> signatures_message_data_; |
178 | 183 |
179 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); | 184 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); |
180 }; | 185 }; |
181 | 186 |
182 } // namespace chromeos_update_engine | 187 } // namespace chromeos_update_engine |
183 | 188 |
184 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 189 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
OLD | NEW |