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

Unified Diff: remoting/protocol/channel_authenticator.cc

Issue 7528015: Use HMAC SHA-256, since SHA-1 won't work inside the Windows sandbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update copyright year. Created 9 years, 4 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 | « no previous file | remoting/protocol/jingle_session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_authenticator.cc
diff --git a/remoting/protocol/channel_authenticator.cc b/remoting/protocol/channel_authenticator.cc
index fefab189138b74054c0c05f8c42b93520ee83b94..2e427a95aab39c514909743c850f8d29b997b207 100644
--- a/remoting/protocol/channel_authenticator.cc
+++ b/remoting/protocol/channel_authenticator.cc
@@ -21,21 +21,21 @@ namespace {
// Labels for use when exporting the SSL master keys.
const char kClientSslExporterLabel[] = "EXPORTER-remoting-channel-auth-client";
-// Size of the HMAC-SHA-1 authentication digest.
-const size_t kAuthDigestLength = 20;
+// Size of the HMAC-SHA-256 authentication digest.
+const size_t kAuthDigestLength = 32;
// static
bool GetAuthBytes(const std::string& shared_secret,
const std::string& key_material,
std::string* auth_bytes) {
// Generate auth digest based on the keying material and shared secret.
- crypto::HMAC response(crypto::HMAC::SHA1);
- if (!response.Init(shared_secret)) {
+ crypto::HMAC response(crypto::HMAC::SHA256);
+ if (!response.Init(key_material)) {
NOTREACHED() << "HMAC::Init failed";
return false;
}
unsigned char out_bytes[kAuthDigestLength];
- if (!response.Sign(key_material, out_bytes, kAuthDigestLength)) {
+ if (!response.Sign(shared_secret, out_bytes, kAuthDigestLength)) {
NOTREACHED() << "HMAC::Sign failed";
return false;
}
« no previous file with comments | « no previous file | remoting/protocol/jingle_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698