diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-30 05:18:01 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-30 05:18:01 +0000 |
commit | 6df5b9e3d5890b559b903c74b57cf7ab7c1b6310 (patch) | |
tree | 79b1d83dc536e153169387337c863e2a4394b555 /chrome/browser/internal_auth.cc | |
parent | 80ec9ba8e66350c61b8e1911f54f9d9228b58d63 (diff) | |
download | chromium_src-6df5b9e3d5890b559b903c74b57cf7ab7c1b6310.zip chromium_src-6df5b9e3d5890b559b903c74b57cf7ab7c1b6310.tar.gz chromium_src-6df5b9e3d5890b559b903c74b57cf7ab7c1b6310.tar.bz2 |
Add WARN_UNUSED_RESULT to crypto/hmac.h
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7522014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/internal_auth.cc')
-rw-r--r-- | chrome/browser/internal_auth.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/internal_auth.cc b/chrome/browser/internal_auth.cc index 268ee1b..ac8d91f 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); |