diff options
author | sergeyu <sergeyu@chromium.org> | 2016-03-08 21:37:03 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 05:38:32 +0000 |
commit | 42cb6f9f0990561fa6c5e8bf436b6dcd60d0b52f (patch) | |
tree | d57de28901a65540030b555029fc6be30cf111f1 /remoting/host | |
parent | 020716dc6d2dc9e3e2bd59de86ad27dd50e904b2 (diff) | |
download | chromium_src-42cb6f9f0990561fa6c5e8bf436b6dcd60d0b52f.zip chromium_src-42cb6f9f0990561fa6c5e8bf436b6dcd60d0b52f.tar.gz chromium_src-42cb6f9f0990561fa6c5e8bf436b6dcd60d0b52f.tar.bz2 |
Cleanup AuthenticationMethod usage.
Previously AuthenticationMethod type was used in many places. Removed
all dependencies on it except from NegotiatingAuthenticator classes.
AuthenticationMethod has been moved to
NegotiatingAuthenticatorBase::Method.
Also includes the following cleanups:
- removed old authentication functions from auth_util.cc which were
no longer needed.
- Remove HashFunction enum as it wasn't useful.
BUG=589698
Review URL: https://codereview.chromium.org/1768383004
Cr-Commit-Position: refs/heads/master@{#380078}
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/pin_hash.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/remoting/host/pin_hash.cc b/remoting/host/pin_hash.cc index d0ee42d..6247a5e 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; } |