Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: delta_performer_unittest.cc

Issue 6271003: AU: Support signed payload verification through the delta generator. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | generate_delta_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include <sys/mount.h> 5 #include <sys/mount.h>
6 #include <inttypes.h> 6 #include <inttypes.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ASSERT_TRUE(PayloadSigner::HashPayloadForSigning(delta_path, 231 ASSERT_TRUE(PayloadSigner::HashPayloadForSigning(delta_path,
232 signature_size, 232 signature_size,
233 &hash)); 233 &hash));
234 vector<char> signature; 234 vector<char> signature;
235 ASSERT_TRUE(PayloadSigner::SignHash(hash, 235 ASSERT_TRUE(PayloadSigner::SignHash(hash,
236 kUnittestPrivateKeyPath, 236 kUnittestPrivateKeyPath,
237 &signature)); 237 &signature));
238 ASSERT_TRUE(PayloadSigner::AddSignatureToPayload(delta_path, 238 ASSERT_TRUE(PayloadSigner::AddSignatureToPayload(delta_path,
239 signature, 239 signature,
240 delta_path)); 240 delta_path));
241 EXPECT_TRUE(PayloadSigner::VerifySignedPayload(delta_path,
242 kUnittestPublicKeyPath));
241 } 243 }
242 244
243 // Read delta into memory. 245 // Read delta into memory.
244 vector<char> delta; 246 vector<char> delta;
245 EXPECT_TRUE(utils::ReadFile(delta_path, &delta)); 247 EXPECT_TRUE(utils::ReadFile(delta_path, &delta));
246 248
247 uint64_t manifest_metadata_size; 249 uint64_t manifest_metadata_size;
248 250
249 // Check the metadata. 251 // Check the metadata.
250 { 252 {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 op.clear_src_extents(); 422 op.clear_src_extents();
421 *(op.add_src_extents()) = ExtentForRange(5, 3); 423 *(op.add_src_extents()) = ExtentForRange(5, 3);
422 EXPECT_TRUE(DeltaPerformer::IsIdempotentOperation(op)); 424 EXPECT_TRUE(DeltaPerformer::IsIdempotentOperation(op));
423 *(op.add_dst_extents()) = ExtentForRange(20, 6); 425 *(op.add_dst_extents()) = ExtentForRange(20, 6);
424 EXPECT_TRUE(DeltaPerformer::IsIdempotentOperation(op)); 426 EXPECT_TRUE(DeltaPerformer::IsIdempotentOperation(op));
425 *(op.add_src_extents()) = ExtentForRange(19, 2); 427 *(op.add_src_extents()) = ExtentForRange(19, 2);
426 EXPECT_FALSE(DeltaPerformer::IsIdempotentOperation(op)); 428 EXPECT_FALSE(DeltaPerformer::IsIdempotentOperation(op));
427 } 429 }
428 430
429 } // namespace chromeos_update_engine 431 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | generate_delta_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698