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); |