| Index: remoting/host/client_session.cc
|
| diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
|
| index 52feba70462efae8bc4d28cce9f9f09cd605d073..a190aa52c0543b5e22840b11024809800b9d6932 100644
|
| --- a/remoting/host/client_session.cc
|
| +++ b/remoting/host/client_session.cc
|
| @@ -45,7 +45,8 @@ ClientSession::ClientSession(
|
| scoped_ptr<protocol::ConnectionToClient> connection,
|
| DesktopEnvironmentFactory* desktop_environment_factory,
|
| const base::TimeDelta& max_duration,
|
| - scoped_refptr<protocol::PairingRegistry> pairing_registry)
|
| + scoped_refptr<protocol::PairingRegistry> pairing_registry,
|
| + bool enable_gnubby_auth)
|
| : event_handler_(event_handler),
|
| connection_(connection.Pass()),
|
| client_jid_(connection_->session()->jid()),
|
| @@ -66,7 +67,8 @@ ClientSession::ClientSession(
|
| video_encode_task_runner_(video_encode_task_runner),
|
| network_task_runner_(network_task_runner),
|
| ui_task_runner_(ui_task_runner),
|
| - pairing_registry_(pairing_registry) {
|
| + pairing_registry_(pairing_registry),
|
| + enable_gnubby_auth_(enable_gnubby_auth) {
|
| connection_->SetEventHandler(this);
|
|
|
| // TODO(sergeyu): Currently ConnectionToClient expects stubs to be
|
| @@ -197,9 +199,15 @@ void ClientSession::DeliverClientMessage(
|
| reply.set_data(message.data().substr(0, 16));
|
| connection_->client_stub()->DeliverHostMessage(reply);
|
| return;
|
| + } else if (message.type() == "gnubby-auth") {
|
| + if (gnubby_auth_handler_) {
|
| + gnubby_auth_handler_->DeliverClientMessage(message.data());
|
| + } else {
|
| + HOST_LOG << "gnubby auth is not enabled";
|
| + }
|
| + return;
|
| }
|
| }
|
| - // No messages are currently supported.
|
| HOST_LOG << "Unexpected message received: "
|
| << message.type() << ": " << message.data();
|
| }
|
| @@ -288,6 +296,12 @@ void ClientSession::OnConnectionAuthenticated(
|
| audio_encoder.Pass(),
|
| connection_->audio_stub());
|
| }
|
| +
|
| + if (enable_gnubby_auth_) {
|
| + // Create a GnubbyAuthHandler to proxy gnubbyd messages.
|
| + gnubby_auth_handler_.reset(
|
| + new GnubbyAuthHandler(connection_->client_stub()));
|
| + }
|
| }
|
|
|
| void ClientSession::OnConnectionChannelsConnected(
|
| @@ -412,6 +426,11 @@ void ClientSession::SetDisableInputs(bool disable_inputs) {
|
| disable_clipboard_filter_.set_enabled(!disable_inputs);
|
| }
|
|
|
| +void ClientSession::SetGnubbyAuthHandlerForTesting(
|
| + GnubbyAuthHandler* gnubby_auth_handler) {
|
| + gnubby_auth_handler_.reset(gnubby_auth_handler);
|
| +}
|
| +
|
| scoped_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() {
|
| DCHECK(CalledOnValidThread());
|
|
|
|
|