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

Unified Diff: remoting/protocol/jingle_session.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 | « net/url_request/url_request_http_job.cc ('k') | remoting/protocol/secure_p2p_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 84853364557f3a5c5d32bf2360e279748607775b..1ff3b489caacb5aa686b457dafcc924b30541007 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -71,12 +71,15 @@ bool GetChannelKey(const std::string& channel_name,
const std::string& master_key,
std::string* channel_key) {
crypto::HMAC hmac(crypto::HMAC::SHA256);
- hmac.Init(channel_name);
+ if (!hmac.Init(channel_name)) {
+ channel_key->clear();
+ return false;
+ }
channel_key->resize(kChannelKeyLength);
if (!hmac.Sign(master_key,
reinterpret_cast<unsigned char*>(&(*channel_key)[0]),
channel_key->size())) {
- *channel_key = "";
+ channel_key->clear();
return false;
}
return true;
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | remoting/protocol/secure_p2p_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698