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

Unified Diff: remoting/host/plugin/host_script_object.cc

Issue 10243011: [Chromoting] Factor out common code for pin hashing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync. Created 8 years, 8 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/host/pin_hash_unittest.cc ('k') | remoting/host/verify_config_window_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/host_script_object.cc
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index dae526e06058761ffc53aa374af07b562d01e49f..760d916f2ac3e7bf712e222562e46b87fb01cf41 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -4,7 +4,6 @@
#include "remoting/host/plugin/host_script_object.h"
-#include "base/base64.h"
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
@@ -23,12 +22,12 @@
#include "remoting/host/host_key_pair.h"
#include "remoting/host/host_secret.h"
#include "remoting/host/it2me_host_user_interface.h"
+#include "remoting/host/pin_hash.h"
#include "remoting/host/plugin/daemon_controller.h"
#include "remoting/host/plugin/host_log_handler.h"
#include "remoting/host/policy_hack/nat_policy.h"
#include "remoting/host/register_support_host_request.h"
#include "remoting/jingle_glue/xmpp_signal_strategy.h"
-#include "remoting/protocol/authentication_method.h"
#include "remoting/protocol/it2me_host_authenticator_factory.h"
namespace remoting {
@@ -638,15 +637,7 @@ bool HostNPScriptObject::GetPinHash(const NPVariant* args,
}
std::string pin = StringFromNPVariant(args[1]);
- std::string hash = protocol::AuthenticationMethod::ApplyHashFunction(
- protocol::AuthenticationMethod::HMAC_SHA256, host_id, pin);
- std::string hash_base64;
- bool base64_result = base::Base64Encode(hash, &hash_base64);
- if (!base64_result) {
- LOG(FATAL) << "Base64Encode failed";
- }
-
- *result = NPVariantFromString(hash_base64);
+ *result = NPVariantFromString(remoting::MakeHostPinHash(host_id, pin));
return true;
}
« no previous file with comments | « remoting/host/pin_hash_unittest.cc ('k') | remoting/host/verify_config_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698