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

Unified Diff: crypto/hmac.cc

Issue 2934893003: Deleted redundant SymmetricKey::GetRawKey(). (Closed)
Patch Set: Rebased to fix conflict with ToT. Created 3 years, 6 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 | « components/sync/base/nigori_unittest.cc ('k') | crypto/symmetric_key.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hmac.cc
diff --git a/crypto/hmac.cc b/crypto/hmac.cc
index 0480099e9cbebcbe362e0737d94e874ee0691996..4db1f6e1bf01332d36da0e329e9d89978ceb1b0c 100644
--- a/crypto/hmac.cc
+++ b/crypto/hmac.cc
@@ -50,12 +50,7 @@ bool HMAC::Init(const unsigned char* key, size_t key_length) {
}
bool HMAC::Init(const SymmetricKey* key) {
- std::string raw_key;
- bool result = key->GetRawKey(&raw_key) && Init(raw_key);
- // Zero out key copy. This might get optimized away, but one can hope.
- // Using std::string to store key info at all is a larger problem.
- std::fill(raw_key.begin(), raw_key.end(), 0);
- return result;
+ return Init(key->key());
}
bool HMAC::Sign(const base::StringPiece& data,
« no previous file with comments | « components/sync/base/nigori_unittest.cc ('k') | crypto/symmetric_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698