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

Unified Diff: chrome/browser/internal_auth.cc

Issue 7522014: Add WARN_UNUSED_RESULT to crypto/hmac.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto CL 7532020 and update remoting Created 9 years, 5 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 | « no previous file | chrome/common/net/gaia/oauth_request_signer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/internal_auth.cc
diff --git a/chrome/browser/internal_auth.cc b/chrome/browser/internal_auth.cc
index 268ee1be3fedb4cb72e662637168df75b19abe44..ac8d91f1d6bd8e4bf3314019cd2c5bbba979864d 100644
--- a/chrome/browser/internal_auth.cc
+++ b/chrome/browser/internal_auth.cc
@@ -251,8 +251,11 @@ class InternalAuthVerificationService {
if (key.size() != kKeySizeInBytes)
return;
- engine_.reset(new crypto::HMAC(crypto::HMAC::SHA256));
- engine_->Init(key);
+ scoped_ptr<crypto::HMAC> new_engine(
+ new crypto::HMAC(crypto::HMAC::SHA256));
+ if (!new_engine->Init(key))
+ return;
+ engine_.swap(new_engine);
key_ = key;
key_change_tick_ = GetCurrentTick();
}
@@ -347,9 +350,12 @@ class InternalAuthGenerationService : public base::ThreadChecker {
&InternalAuthGenerationService::GenerateNewKey);
}
- engine_.reset(new crypto::HMAC(crypto::HMAC::SHA256));
+ scoped_ptr<crypto::HMAC> new_engine(
+ new crypto::HMAC(crypto::HMAC::SHA256));
std::string key = base::RandBytesAsString(kKeySizeInBytes);
- engine_->Init(key);
+ if (!new_engine->Init(key))
+ return;
+ engine_.swap(new_engine);
key_regeneration_tick_ = GetCurrentTick();
g_verification_service.Get().ChangeKey(key);
std::fill(key.begin(), key.end(), 0);
« no previous file with comments | « no previous file | chrome/common/net/gaia/oauth_request_signer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698