summaryrefslogtreecommitdiffstats
path: root/crypto/hmac_mac.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-30 05:18:01 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-30 05:18:01 +0000
commit6df5b9e3d5890b559b903c74b57cf7ab7c1b6310 (patch)
tree79b1d83dc536e153169387337c863e2a4394b555 /crypto/hmac_mac.cc
parent80ec9ba8e66350c61b8e1911f54f9d9228b58d63 (diff)
downloadchromium_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 'crypto/hmac_mac.cc')
-rw-r--r--crypto/hmac_mac.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/hmac_mac.cc b/crypto/hmac_mac.cc
index f9a00cd..36caa0d 100644
--- a/crypto/hmac_mac.cc
+++ b/crypto/hmac_mac.cc
@@ -42,6 +42,12 @@ HMAC::~HMAC() {
bool HMAC::Sign(const base::StringPiece& data,
unsigned char* digest,
int digest_length) const {
+ if (plat_->key_.empty()) {
+ // Init has not been called or has failed.
+ NOTREACHED();
+ return false;
+ }
+
CCHmacAlgorithm algorithm;
int algorithm_digest_length;
switch (hash_alg_) {