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

Unified Diff: crypto/hmac.h

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 | « chrome/common/net/gaia/oauth_request_signer.cc ('k') | crypto/hmac_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hmac.h
diff --git a/crypto/hmac.h b/crypto/hmac.h
index 73d6dc3ddb215820010450ed5a5dca6f7936f24a..e52d5191fc5d7b18daa62d78aa4326cb8630b319 100644
--- a/crypto/hmac.h
+++ b/crypto/hmac.h
@@ -10,6 +10,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_piece.h"
#include "crypto/crypto_api.h"
@@ -38,11 +39,11 @@ class CRYPTO_API HMAC {
// Initializes this instance using |key| of the length |key_length|. Call Init
// only once. It returns false on the second or later calls.
// TODO(abarth): key_length should be a size_t.
- bool Init(const unsigned char* key, int key_length);
+ bool Init(const unsigned char* key, int key_length) WARN_UNUSED_RESULT;
// Initializes this instance using |key|. Call Init only once. It returns
// false on the second or later calls.
- bool Init(const base::StringPiece& key) {
+ bool Init(const base::StringPiece& key) WARN_UNUSED_RESULT {
return Init(reinterpret_cast<const unsigned char*>(key.data()),
static_cast<int>(key.size()));
}
@@ -52,7 +53,7 @@ class CRYPTO_API HMAC {
// returned in |digest|, which has |digest_length| bytes of storage available.
// TODO(abarth): digest_length should be a size_t.
bool Sign(const base::StringPiece& data, unsigned char* digest,
- int digest_length) const;
+ int digest_length) const WARN_UNUSED_RESULT;
// Verifies that the HMAC for the message in |data| equals the HMAC provided
// in |digest|, using the algorithm supplied to the constructor and the key
@@ -62,12 +63,13 @@ class CRYPTO_API HMAC {
// undermine the cryptographic integrity. |digest| must be exactly
// |DigestLength()| bytes long.
bool Verify(const base::StringPiece& data,
- const base::StringPiece& digest) const;
+ const base::StringPiece& digest) const WARN_UNUSED_RESULT;
// Verifies a truncated HMAC, behaving identical to Verify(), except
// that |digest| is allowed to be smaller than |DigestLength()|.
- bool VerifyTruncated(const base::StringPiece& data,
- const base::StringPiece& digest) const;
+ bool VerifyTruncated(
+ const base::StringPiece& data,
+ const base::StringPiece& digest) const WARN_UNUSED_RESULT;
private:
HashAlgorithm hash_alg_;
« no previous file with comments | « chrome/common/net/gaia/oauth_request_signer.cc ('k') | crypto/hmac_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698