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

Side by Side Diff: delta_performer.cc

Issue 6574009: If a public key is present, disallow old style full payloads. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 10 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 | « delta_performer.h ('k') | omaha_response_handler_action.h » ('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) 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 15 matching lines...) Expand all
26 #include "update_engine/subprocess.h" 26 #include "update_engine/subprocess.h"
27 #include "update_engine/terminator.h" 27 #include "update_engine/terminator.h"
28 28
29 using std::min; 29 using std::min;
30 using std::string; 30 using std::string;
31 using std::vector; 31 using std::vector;
32 using google::protobuf::RepeatedPtrField; 32 using google::protobuf::RepeatedPtrField;
33 33
34 namespace chromeos_update_engine { 34 namespace chromeos_update_engine {
35 35
36 const char DeltaPerformer::kUpdatePayloadPublicKeyPath[] =
37 "/usr/share/update_engine/update-payload-key.pub.pem";
38
36 namespace { 39 namespace {
37 40
38 const int kDeltaVersionLength = 8; 41 const int kDeltaVersionLength = 8;
39 const int kDeltaProtobufLengthLength = 8; 42 const int kDeltaProtobufLengthLength = 8;
40 const char kUpdatePayloadPublicKeyPath[] =
41 "/usr/share/update_engine/update-payload-key.pub.pem";
42 const int kUpdateStateOperationInvalid = -1; 43 const int kUpdateStateOperationInvalid = -1;
43 const int kMaxResumedUpdateFailures = 10; 44 const int kMaxResumedUpdateFailures = 10;
44 45
45 // Converts extents to a human-readable string, for use by DumpUpdateProto(). 46 // Converts extents to a human-readable string, for use by DumpUpdateProto().
46 string ExtentsToString(const RepeatedPtrField<Extent>& extents) { 47 string ExtentsToString(const RepeatedPtrField<Extent>& extents) {
47 string ret; 48 string ret;
48 for (int i = 0; i < extents.size(); i++) { 49 for (int i = 0; i < extents.size(); i++) {
49 const Extent& extent = extents.Get(i); 50 const Extent& extent = extents.Get(i);
50 if (extent.start_block() == kSparseHole) { 51 if (extent.start_block() == kSparseHole) {
51 ret += StringPrintf("{kSparseHole, %" PRIu64 "}, ", extent.num_blocks()); 52 ret += StringPrintf("{kSparseHole, %" PRIu64 "}, ", extent.num_blocks());
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 if (prefs_->GetInt64(kPrefsResumedUpdateFailures, &resumed_update_failures)) { 763 if (prefs_->GetInt64(kPrefsResumedUpdateFailures, &resumed_update_failures)) {
763 resumed_update_failures++; 764 resumed_update_failures++;
764 } else { 765 } else {
765 resumed_update_failures = 1; 766 resumed_update_failures = 1;
766 } 767 }
767 prefs_->SetInt64(kPrefsResumedUpdateFailures, resumed_update_failures); 768 prefs_->SetInt64(kPrefsResumedUpdateFailures, resumed_update_failures);
768 return true; 769 return true;
769 } 770 }
770 771
771 } // namespace chromeos_update_engine 772 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « delta_performer.h ('k') | omaha_response_handler_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698