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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 2167473003: Revert of Renaming Gnubby and RemoteSecurityKey files/classes/members (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "remoting/host/host_status_logger.h" 65 #include "remoting/host/host_status_logger.h"
66 #include "remoting/host/input_injector.h" 66 #include "remoting/host/input_injector.h"
67 #include "remoting/host/ipc_desktop_environment.h" 67 #include "remoting/host/ipc_desktop_environment.h"
68 #include "remoting/host/ipc_host_event_logger.h" 68 #include "remoting/host/ipc_host_event_logger.h"
69 #include "remoting/host/logging.h" 69 #include "remoting/host/logging.h"
70 #include "remoting/host/me2me_desktop_environment.h" 70 #include "remoting/host/me2me_desktop_environment.h"
71 #include "remoting/host/oauth_token_getter_impl.h" 71 #include "remoting/host/oauth_token_getter_impl.h"
72 #include "remoting/host/pairing_registry_delegate.h" 72 #include "remoting/host/pairing_registry_delegate.h"
73 #include "remoting/host/pin_hash.h" 73 #include "remoting/host/pin_hash.h"
74 #include "remoting/host/policy_watcher.h" 74 #include "remoting/host/policy_watcher.h"
75 #include "remoting/host/security_key/security_key_auth_handler.h" 75 #include "remoting/host/security_key/gnubby_auth_handler.h"
76 #include "remoting/host/security_key/security_key_extension.h" 76 #include "remoting/host/security_key/gnubby_extension.h"
77 #include "remoting/host/service_urls.h" 77 #include "remoting/host/service_urls.h"
78 #include "remoting/host/shutdown_watchdog.h" 78 #include "remoting/host/shutdown_watchdog.h"
79 #include "remoting/host/signaling_connector.h" 79 #include "remoting/host/signaling_connector.h"
80 #include "remoting/host/single_window_desktop_environment.h" 80 #include "remoting/host/single_window_desktop_environment.h"
81 #include "remoting/host/switches.h" 81 #include "remoting/host/switches.h"
82 #include "remoting/host/third_party_auth_config.h" 82 #include "remoting/host/third_party_auth_config.h"
83 #include "remoting/host/token_validator_factory_impl.h" 83 #include "remoting/host/token_validator_factory_impl.h"
84 #include "remoting/host/usage_stats_consent.h" 84 #include "remoting/host/usage_stats_consent.h"
85 #include "remoting/host/username.h" 85 #include "remoting/host/username.h"
86 #include "remoting/protocol/authenticator.h" 86 #include "remoting/protocol/authenticator.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // from stdin. 144 // from stdin.
145 const char kStdinConfigPath[] = "-"; 145 const char kStdinConfigPath[] = "-";
146 #endif // !defined(REMOTING_MULTI_PROCESS) 146 #endif // !defined(REMOTING_MULTI_PROCESS)
147 147
148 #if defined(OS_LINUX) 148 #if defined(OS_LINUX)
149 // The command line switch used to pass name of the pipe to capture audio on 149 // The command line switch used to pass name of the pipe to capture audio on
150 // linux. 150 // linux.
151 const char kAudioPipeSwitchName[] = "audio-pipe-name"; 151 const char kAudioPipeSwitchName[] = "audio-pipe-name";
152 152
153 // The command line switch used to pass name of the unix domain socket used to 153 // The command line switch used to pass name of the unix domain socket used to
154 // listen for security key requests. 154 // listen for gnubby requests.
155 const char kAuthSocknameSwitchName[] = "ssh-auth-sockname"; 155 const char kAuthSocknameSwitchName[] = "ssh-auth-sockname";
156 #endif // defined(OS_LINUX) 156 #endif // defined(OS_LINUX)
157 157
158 // The command line switch used by the parent to request the host to signal it 158 // The command line switch used by the parent to request the host to signal it
159 // when it is successfully started. 159 // when it is successfully started.
160 const char kSignalParentSwitchName[] = "signal-parent"; 160 const char kSignalParentSwitchName[] = "signal-parent";
161 161
162 // Command line switch used to enable VP9 encoding. 162 // Command line switch used to enable VP9 encoding.
163 const char kEnableVp9SwitchName[] = "enable-vp9"; 163 const char kEnableVp9SwitchName[] = "enable-vp9";
164 164
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 std::string host_domain_; 367 std::string host_domain_;
368 bool host_username_match_required_ = false; 368 bool host_username_match_required_ = false;
369 bool allow_nat_traversal_ = true; 369 bool allow_nat_traversal_ = true;
370 bool allow_relay_ = true; 370 bool allow_relay_ = true;
371 PortRange udp_port_range_; 371 PortRange udp_port_range_;
372 std::string talkgadget_prefix_; 372 std::string talkgadget_prefix_;
373 bool allow_pairing_ = true; 373 bool allow_pairing_ = true;
374 374
375 bool curtain_required_ = false; 375 bool curtain_required_ = false;
376 ThirdPartyAuthConfig third_party_auth_config_; 376 ThirdPartyAuthConfig third_party_auth_config_;
377 bool security_key_auth_policy_enabled_ = false; 377 bool gnubby_auth_policy_enabled_ = false;
378 bool security_key_extension_supported_ = false; 378 bool gnubby_extension_supported_ = false;
379 379
380 // Boolean to change flow, where necessary, if we're 380 // Boolean to change flow, where necessary, if we're
381 // capturing a window instead of the entire desktop. 381 // capturing a window instead of the entire desktop.
382 bool enable_window_capture_ = false; 382 bool enable_window_capture_ = false;
383 383
384 // Used to specify which window to stream, if enabled. 384 // Used to specify which window to stream, if enabled.
385 webrtc::WindowId window_id_ = 0; 385 webrtc::WindowId window_id_ = 0;
386 386
387 // Must outlive |gcd_state_updater_| and |signaling_connector_|. 387 // Must outlive |gcd_state_updater_| and |signaling_connector_|.
388 std::unique_ptr<OAuthTokenGetter> oauth_token_getter_; 388 std::unique_ptr<OAuthTokenGetter> oauth_token_getter_;
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 #if defined(OS_LINUX) 809 #if defined(OS_LINUX)
810 // If an audio pipe is specific on the command-line then initialize 810 // If an audio pipe is specific on the command-line then initialize
811 // AudioCapturerLinux to capture from it. 811 // AudioCapturerLinux to capture from it.
812 base::FilePath audio_pipe_name = base::CommandLine::ForCurrentProcess()-> 812 base::FilePath audio_pipe_name = base::CommandLine::ForCurrentProcess()->
813 GetSwitchValuePath(kAudioPipeSwitchName); 813 GetSwitchValuePath(kAudioPipeSwitchName);
814 if (!audio_pipe_name.empty()) { 814 if (!audio_pipe_name.empty()) {
815 remoting::AudioCapturerLinux::InitializePipeReader( 815 remoting::AudioCapturerLinux::InitializePipeReader(
816 context_->audio_task_runner(), audio_pipe_name); 816 context_->audio_task_runner(), audio_pipe_name);
817 } 817 }
818 818
819 base::FilePath security_key_socket_name = 819 base::FilePath gnubby_socket_name = base::CommandLine::ForCurrentProcess()->
820 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( 820 GetSwitchValuePath(kAuthSocknameSwitchName);
821 kAuthSocknameSwitchName); 821 if (!gnubby_socket_name.empty()) {
822 if (!security_key_socket_name.empty()) { 822 remoting::GnubbyAuthHandler::SetGnubbySocketName(gnubby_socket_name);
823 remoting::SecurityKeyAuthHandler::SetSecurityKeySocketName( 823 gnubby_extension_supported_ = true;
824 security_key_socket_name);
825 security_key_extension_supported_ = true;
826 } 824 }
827 #elif defined(OS_WIN) 825 #elif defined(OS_WIN)
828 // TODO(joedow): Remove the conditional once this is supported on OSX. 826 // TODO(joedow): Remove the conditional once this is supported on OSX.
829 security_key_extension_supported_ = true; 827 gnubby_extension_supported_ = true;
830 #endif // defined(OS_WIN) 828 #endif // defined(OS_WIN)
831 829
832 // Create a desktop environment factory appropriate to the build type & 830 // Create a desktop environment factory appropriate to the build type &
833 // platform. 831 // platform.
834 #if defined(REMOTING_MULTI_PROCESS) 832 #if defined(REMOTING_MULTI_PROCESS)
835 IpcDesktopEnvironmentFactory* desktop_environment_factory = 833 IpcDesktopEnvironmentFactory* desktop_environment_factory =
836 new IpcDesktopEnvironmentFactory( 834 new IpcDesktopEnvironmentFactory(
837 context_->audio_task_runner(), context_->network_task_runner(), 835 context_->audio_task_runner(), context_->network_task_runner(),
838 context_->network_task_runner(), daemon_channel_.get()); 836 context_->network_task_runner(), daemon_channel_.get());
839 desktop_session_connector_ = desktop_environment_factory; 837 desktop_session_connector_ = desktop_environment_factory;
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 } else { 1310 } else {
1313 HOST_LOG << "Policy disables client pairing."; 1311 HOST_LOG << "Policy disables client pairing.";
1314 } 1312 }
1315 return true; 1313 return true;
1316 } 1314 }
1317 1315
1318 bool HostProcess::OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies) { 1316 bool HostProcess::OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies) {
1319 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); 1317 DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
1320 1318
1321 if (!policies->GetBoolean(policy::key::kRemoteAccessHostAllowGnubbyAuth, 1319 if (!policies->GetBoolean(policy::key::kRemoteAccessHostAllowGnubbyAuth,
1322 &security_key_auth_policy_enabled_)) { 1320 &gnubby_auth_policy_enabled_)) {
1323 return false; 1321 return false;
1324 } 1322 }
1325 1323
1326 if (security_key_auth_policy_enabled_) { 1324 if (gnubby_auth_policy_enabled_) {
1327 HOST_LOG << "Policy enables security key auth."; 1325 HOST_LOG << "Policy enables gnubby auth.";
1328 } else { 1326 } else {
1329 HOST_LOG << "Policy disables security key auth."; 1327 HOST_LOG << "Policy disables gnubby auth.";
1330 } 1328 }
1331 1329
1332 return true; 1330 return true;
1333 } 1331 }
1334 1332
1335 void HostProcess::InitializeSignaling() { 1333 void HostProcess::InitializeSignaling() {
1336 DCHECK(!host_id_.empty()); // ApplyConfig() should already have been run. 1334 DCHECK(!host_id_.empty()); // ApplyConfig() should already have been run.
1337 1335
1338 DCHECK(!signal_strategy_); 1336 DCHECK(!signal_strategy_);
1339 DCHECK(!oauth_token_getter_); 1337 DCHECK(!oauth_token_getter_);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 if (enable_vp9_) 1451 if (enable_vp9_)
1454 protocol_config->set_vp9_experiment_enabled(true); 1452 protocol_config->set_vp9_experiment_enabled(true);
1455 protocol_config->set_webrtc_supported(true); 1453 protocol_config->set_webrtc_supported(true);
1456 session_manager->set_protocol_config(std::move(protocol_config)); 1454 session_manager->set_protocol_config(std::move(protocol_config));
1457 1455
1458 host_.reset(new ChromotingHost(desktop_environment_factory_.get(), 1456 host_.reset(new ChromotingHost(desktop_environment_factory_.get(),
1459 std::move(session_manager), transport_context, 1457 std::move(session_manager), transport_context,
1460 context_->audio_task_runner(), 1458 context_->audio_task_runner(),
1461 context_->video_encode_task_runner())); 1459 context_->video_encode_task_runner()));
1462 1460
1463 if (security_key_auth_policy_enabled_ && security_key_extension_supported_) { 1461 if (gnubby_auth_policy_enabled_ && gnubby_extension_supported_) {
1464 host_->AddExtension(base::WrapUnique(new SecurityKeyExtension())); 1462 host_->AddExtension(base::WrapUnique(new GnubbyExtension()));
1465 } 1463 }
1466 1464
1467 // TODO(simonmorris): Get the maximum session duration from a policy. 1465 // TODO(simonmorris): Get the maximum session duration from a policy.
1468 #if defined(OS_LINUX) 1466 #if defined(OS_LINUX)
1469 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); 1467 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20));
1470 #endif 1468 #endif
1471 1469
1472 host_change_notification_listener_.reset(new HostChangeNotificationListener( 1470 host_change_notification_listener_.reset(new HostChangeNotificationListener(
1473 this, host_id_, signal_strategy_.get(), directory_bot_jid_)); 1471 this, host_id_, signal_strategy_.get(), directory_bot_jid_));
1474 1472
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); 1663 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds));
1666 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); 1664 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog);
1667 1665
1668 // Run the main (also UI) message loop until the host no longer needs it. 1666 // Run the main (also UI) message loop until the host no longer needs it.
1669 message_loop.Run(); 1667 message_loop.Run();
1670 1668
1671 return exit_code; 1669 return exit_code;
1672 } 1670 }
1673 1671
1674 } // namespace remoting 1672 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_mock_objects.cc ('k') | remoting/host/security_key/fake_ipc_gnubby_auth_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698