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

Unified Diff: omaha_hash_calculator.h

Issue 3521016: AU: Start checkpointing update progress. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: address review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « generate_delta_main.cc ('k') | omaha_hash_calculator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_hash_calculator.h
diff --git a/omaha_hash_calculator.h b/omaha_hash_calculator.h
index 52ac1b75fd5a9227195bb9f535f5a19513a92f35..7aa37e4338f71ba1eb1a4545d93a89c03761789a 100644
--- a/omaha_hash_calculator.h
+++ b/omaha_hash_calculator.h
@@ -11,11 +11,11 @@
#include "base/basictypes.h"
#include "base/logging.h"
-// Omaha uses base64 encoded SHA-1 as the hash. This class provides a simple
+// Omaha uses base64 encoded SHA-256 as the hash. This class provides a simple
// wrapper around OpenSSL providing such a formatted hash of data passed in.
-// The methods of this class must be called in a very specific order:
-// First the ctor (of course), then 0 or more calls to Update(), then
-// Finalize(), then 0 or more calls to hash().
+// The methods of this class must be called in a very specific order: First the
+// ctor (of course), then 0 or more calls to Update(), then Finalize(), then 0
+// or more calls to hash().
namespace chromeos_update_engine {
@@ -45,6 +45,15 @@ class OmahaHashCalculator {
return raw_hash_;
}
+ // Gets the current hash context. Note that the string will contain binary
+ // data (including \0 characters).
+ std::string GetContext() const;
+
+ // Sets the current hash context. |context| must the string returned by a
+ // previous OmahaHashCalculator::GetContext method call. Returns true on
+ // success, and false otherwise.
+ bool SetContext(const std::string& context);
+
static bool RawHashOfData(const std::vector<char>& data,
std::vector<char>* out_hash);
« no previous file with comments | « generate_delta_main.cc ('k') | omaha_hash_calculator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698