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

Unified Diff: crypto/hmac_mac.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 | « crypto/hmac.h ('k') | net/http/http_mac_signature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hmac_mac.cc
diff --git a/crypto/hmac_mac.cc b/crypto/hmac_mac.cc
index f9a00cda8adaab7da1a65f24187b5b6f0a70e812..36caa0df8ebf71c50c51f0285469857422294960 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_) {
« no previous file with comments | « crypto/hmac.h ('k') | net/http/http_mac_signature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698