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

Unified Diff: remoting/host/it2me/it2me_host.cc

Issue 1643793002: Add policy to restrict client domain for Me2Me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remoting_perftests compile. Created 4 years, 10 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/it2me/it2me_host.h ('k') | remoting/host/policy_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_host.cc
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc
index 99f317713f54e45f9839916f3be60ad08accafd9..4012f550c595870f5a94ea7b888598c2584234c7 100644
--- a/remoting/host/it2me/it2me_host.cc
+++ b/remoting/host/it2me/it2me_host.cc
@@ -332,6 +332,11 @@ void It2MeHost::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) {
if (policies->GetString(policy::key::kRemoteAccessHostDomain, &host_domain)) {
UpdateHostDomainPolicy(host_domain);
}
+ std::string client_domain;
+ if (policies->GetString(policy::key::kRemoteAccessHostClientDomain,
+ &client_domain)) {
+ UpdateClientDomainPolicy(client_domain);
+ }
policy_received_ = true;
@@ -377,6 +382,19 @@ void It2MeHost::UpdateHostDomainPolicy(const std::string& host_domain) {
required_host_domain_ = host_domain;
}
+void It2MeHost::UpdateClientDomainPolicy(const std::string& client_domain) {
+ DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
+
+ VLOG(2) << "UpdateClientDomainPolicy: " << client_domain;
+
+ // When setting a client domain policy, disconnect any existing session.
+ if (!client_domain.empty() && IsConnected()) {
+ Shutdown();
+ }
+
+ required_client_domain_ = client_domain;
+}
+
It2MeHost::~It2MeHost() {
// Check that resources that need to be torn down on the UI thread are gone.
DCHECK(!desktop_environment_factory_.get());
@@ -459,7 +477,8 @@ void It2MeHost::OnReceivedSupportID(
scoped_ptr<protocol::AuthenticatorFactory> factory(
new protocol::It2MeHostAuthenticatorFactory(
- local_certificate, host_key_pair_, access_code));
+ local_certificate, host_key_pair_, access_code,
+ required_client_domain_));
host_->SetAuthenticatorFactory(std::move(factory));
// Pass the Access Code to the script object before changing state.
« no previous file with comments | « remoting/host/it2me/it2me_host.h ('k') | remoting/host/policy_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698