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

Side by Side Diff: delta_performer.cc

Issue 6771024: AU: Switch to 2048 bit RSA keys; Pad SHA256 hashes appropriately. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: remove debug log statement Created 9 years, 9 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 | delta_performer_unittest.cc » ('j') | payload_signer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "update_engine/delta_performer.h" 5 #include "update_engine/delta_performer.h"
6 6
7 #include <endian.h> 7 #include <endian.h>
8 #include <errno.h> 8 #include <errno.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 return true; 594 return true;
595 } 595 }
596 TEST_AND_RETURN_FALSE(!signatures_message_data_.empty()); 596 TEST_AND_RETURN_FALSE(!signatures_message_data_.empty());
597 vector<char> signed_hash_data; 597 vector<char> signed_hash_data;
598 TEST_AND_RETURN_FALSE(PayloadSigner::VerifySignature(signatures_message_data_, 598 TEST_AND_RETURN_FALSE(PayloadSigner::VerifySignature(signatures_message_data_,
599 key_path, 599 key_path,
600 &signed_hash_data)); 600 &signed_hash_data));
601 OmahaHashCalculator signed_hasher; 601 OmahaHashCalculator signed_hasher;
602 TEST_AND_RETURN_FALSE(signed_hasher.SetContext(signed_hash_context_)); 602 TEST_AND_RETURN_FALSE(signed_hasher.SetContext(signed_hash_context_));
603 TEST_AND_RETURN_FALSE(signed_hasher.Finalize()); 603 TEST_AND_RETURN_FALSE(signed_hasher.Finalize());
604 const vector<char>& hash_data = signed_hasher.raw_hash(); 604 vector<char> hash_data = signed_hasher.raw_hash();
605 PayloadSigner::PadRSA2048SHA256Hash(&hash_data);
605 TEST_AND_RETURN_FALSE(!hash_data.empty()); 606 TEST_AND_RETURN_FALSE(!hash_data.empty());
606 TEST_AND_RETURN_FALSE(hash_data == signed_hash_data); 607 TEST_AND_RETURN_FALSE(hash_data == signed_hash_data);
607 return true; 608 return true;
608 } 609 }
609 610
610 bool DeltaPerformer::GetNewPartitionInfo(uint64_t* kernel_size, 611 bool DeltaPerformer::GetNewPartitionInfo(uint64_t* kernel_size,
611 vector<char>* kernel_hash, 612 vector<char>* kernel_hash,
612 uint64_t* rootfs_size, 613 uint64_t* rootfs_size,
613 vector<char>* rootfs_hash) { 614 vector<char>* rootfs_hash) {
614 TEST_AND_RETURN_FALSE(manifest_valid_ && 615 TEST_AND_RETURN_FALSE(manifest_valid_ &&
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 if (prefs_->GetInt64(kPrefsResumedUpdateFailures, &resumed_update_failures)) { 764 if (prefs_->GetInt64(kPrefsResumedUpdateFailures, &resumed_update_failures)) {
764 resumed_update_failures++; 765 resumed_update_failures++;
765 } else { 766 } else {
766 resumed_update_failures = 1; 767 resumed_update_failures = 1;
767 } 768 }
768 prefs_->SetInt64(kPrefsResumedUpdateFailures, resumed_update_failures); 769 prefs_->SetInt64(kPrefsResumedUpdateFailures, resumed_update_failures);
769 return true; 770 return true;
770 } 771 }
771 772
772 } // namespace chromeos_update_engine 773 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | delta_performer_unittest.cc » ('j') | payload_signer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698