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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index e227c13024217d7fd08ddbbb450a034ae6b7b83d..c1214e25fdca483c677aa2cdb25fb930eb9465bf 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -214,6 +214,7 @@ class HostProcess
bool OnHostTokenUrlPolicyUpdate(const GURL& token_url,
const GURL& token_validation_url);
bool OnPairingPolicyUpdate(bool pairing_enabled);
+ bool OnGnubbyAuthPolicyUpdate(bool enable_gnubby_auth);
void StartHost();
@@ -270,6 +271,7 @@ class HostProcess
bool allow_pairing_;
bool curtain_required_;
+ bool enable_gnubby_auth_;
GURL token_url_;
GURL token_validation_url_;
@@ -302,6 +304,7 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context,
allow_nat_traversal_(true),
allow_pairing_(true),
curtain_required_(false),
+ enable_gnubby_auth_(false),
#if defined(REMOTING_MULTI_PROCESS)
desktop_session_connector_(NULL),
#endif // defined(REMOTING_MULTI_PROCESS)
@@ -793,6 +796,11 @@ void HostProcess::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) {
&bool_value)) {
restart_required |= OnPairingPolicyUpdate(bool_value);
}
+ if (policies->GetBoolean(
+ policy_hack::PolicyWatcher::kHostAllowGnubbyAuthPolicyName,
+ &bool_value)) {
+ restart_required |= OnGnubbyAuthPolicyUpdate(bool_value);
+ }
if (state_ == HOST_INITIALIZING) {
StartHost();
@@ -952,6 +960,21 @@ bool HostProcess::OnPairingPolicyUpdate(bool allow_pairing) {
return true;
}
+bool HostProcess::OnGnubbyAuthPolicyUpdate(bool enable_gnubby_auth) {
+ DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
+
+ if (enable_gnubby_auth_ == enable_gnubby_auth)
+ return false;
+
+ if (enable_gnubby_auth)
+ HOST_LOG << "Policy enables gnubby auth.";
Sergey Ulanov 2014/01/25 02:03:33 add {} because there is else case.
psj 2014/01/29 09:07:15 Done.
+ else
+ HOST_LOG << "Policy disables gnubby auth.";
+ enable_gnubby_auth_ = enable_gnubby_auth;
+
+ return true;
+}
+
void HostProcess::StartHost() {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
DCHECK(!host_);
@@ -1036,6 +1059,7 @@ void HostProcess::StartHost() {
#endif // !defined(REMOTING_MULTI_PROCESS)
host_->SetEnableCurtaining(curtain_required_);
+ host_->SetEnableGnubbyAuth(enable_gnubby_auth_);
host_->Start(host_owner_);
CreateAuthenticatorFactory();

Powered by Google App Engine
This is Rietveld 408576698