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

Side by Side Diff: payload_signer.h

Issue 3592008: AU: Verify delta payload signature and signed hash. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: move /tmp files to /var/run Created 10 years, 2 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 | « omaha_hash_calculator_unittest.cc ('k') | payload_signer.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) 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_PAYLOAD_SIGNER_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 static bool SignPayload(const std::string& unsigned_payload_path, 22 static bool SignPayload(const std::string& unsigned_payload_path,
23 const std::string& private_key_path, 23 const std::string& private_key_path,
24 std::vector<char>* out_signature_blob); 24 std::vector<char>* out_signature_blob);
25 25
26 // Returns the length of out_signature_blob that will result in a call 26 // Returns the length of out_signature_blob that will result in a call
27 // to SignPayload with a given private key. Returns true on success. 27 // to SignPayload with a given private key. Returns true on success.
28 static bool SignatureBlobLength(const std::string& private_key_path, 28 static bool SignatureBlobLength(const std::string& private_key_path,
29 uint64_t* out_length); 29 uint64_t* out_length);
30 30
31 // Returns false if the payload signature can't be verified. Returns true
32 // otherwise and sets |out_hash| to the signed payload hash.
33 static bool VerifySignature(const std::vector<char>& signature_blob,
34 const std::string& public_key_path,
35 std::vector<char>* out_hash_data);
36
31 private: 37 private:
32 // This should never be constructed 38 // This should never be constructed
33 DISALLOW_IMPLICIT_CONSTRUCTORS(PayloadSigner); 39 DISALLOW_IMPLICIT_CONSTRUCTORS(PayloadSigner);
34 }; 40 };
35 41
36 } // namespace chromeos_update_engine 42 } // namespace chromeos_update_engine
37 43
38 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__ 44 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PAYLOAD_SIGNER_H__
OLDNEW
« no previous file with comments | « omaha_hash_calculator_unittest.cc ('k') | payload_signer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698