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

Unified Diff: remoting/host/pin_hash.cc

Issue 1768383004: Cleanup AuthenticatorMethod usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/protocol/auth_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/pin_hash.cc
diff --git a/remoting/host/pin_hash.cc b/remoting/host/pin_hash.cc
index d0ee42d6e96c4999983ca4dcfb77396eeef6a828..6247a5ecafe16d5dcc2eaf0733ac00cfdb598e56 100644
--- a/remoting/host/pin_hash.cc
+++ b/remoting/host/pin_hash.cc
@@ -6,7 +6,7 @@
#include "base/base64.h"
#include "base/logging.h"
-#include "remoting/protocol/authentication_method.h"
+#include "remoting/protocol/auth_util.h"
#include "remoting/protocol/me2me_host_authenticator_factory.h"
namespace remoting {
@@ -23,8 +23,7 @@ bool ParsePinHashFromConfig(const std::string& value,
std::string function_name = value.substr(0, separator);
if (function_name == "plain") {
- *pin_hash_out = protocol::ApplySharedSecretHashFunction(
- protocol::HashFunction::HMAC_SHA256, host_id, *pin_hash_out);
+ *pin_hash_out = protocol::GetSharedSecretHash(host_id, *pin_hash_out);
return true;
} else if (function_name == "hmac") {
return true;
@@ -36,8 +35,7 @@ bool ParsePinHashFromConfig(const std::string& value,
std::string MakeHostPinHash(const std::string& host_id,
const std::string& pin) {
- std::string hash = protocol::ApplySharedSecretHashFunction(
- protocol::HashFunction::HMAC_SHA256, host_id, pin);
+ std::string hash = protocol::GetSharedSecretHash(host_id, pin);
std::string hash_base64;
base::Base64Encode(hash, &hash_base64);
return "hmac:" + hash_base64;
@@ -51,8 +49,7 @@ bool VerifyHostPinHash(const std::string& hash,
LOG(FATAL) << "Failed to parse PIN hash.";
return false;
}
- std::string hash_calculated = protocol::ApplySharedSecretHashFunction(
- protocol::HashFunction::HMAC_SHA256, host_id, pin);
+ std::string hash_calculated = protocol::GetSharedSecretHash(host_id, pin);
return hash_calculated == hash_parsed;
}
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/protocol/auth_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698