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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_util.cc

Issue 88062: Separate the initialization code in the constructor of HMAC class into Init f... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « base/hmac_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_util.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_util.cc (revision 15317)
+++ chrome/browser/safe_browsing/safe_browsing_util.cc (working copy)
@@ -170,9 +170,9 @@
std::string decoded_mac;
net::Base64Decode(mac_copy, &decoded_mac);
- base::HMAC hmac(base::HMAC::SHA1,
- reinterpret_cast<const unsigned char*>(decoded_key.data()),
- static_cast<int>(decoded_key.length()));
+ base::HMAC hmac(base::HMAC::SHA1);
+ if (!hmac.Init(decoded_key))
+ return false;
const std::string data_str(data, data_length);
unsigned char digest[kSafeBrowsingMacDigestSize];
if (!hmac.Sign(data_str, digest, kSafeBrowsingMacDigestSize))
« no previous file with comments | « base/hmac_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698