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

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 1778023002: Move NegotiatingClientAuthentication creation to ChromotingClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/client/jni/chromoting_jni_instance.cc ('k') | remoting/protocol/negotiating_authenticator_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 1365821daa1c53484e6a2fa5e0a7f1bd384e7cbe..e0ca0d5b045568f7917c59bf237c27d80253d890 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -579,26 +579,24 @@ void ChromotingInstance::SetCursorShape(
}
void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
+ protocol::ClientAuthenticationConfig client_auth_config;
+
std::string local_jid;
std::string host_jid;
std::string host_public_key;
- std::string authentication_tag;
if (!data.GetString("hostJid", &host_jid) ||
!data.GetString("hostPublicKey", &host_public_key) ||
!data.GetString("localJid", &local_jid) ||
- !data.GetString("authenticationTag", &authentication_tag)) {
+ !data.GetString("hostId", &client_auth_config.host_id)) {
LOG(ERROR) << "Invalid connect() data.";
return;
}
- std::string client_pairing_id;
- data.GetString("clientPairingId", &client_pairing_id);
- std::string client_paired_secret;
- data.GetString("clientPairedSecret", &client_paired_secret);
+ data.GetString("clientPairingId", &client_auth_config.pairing_client_id);
+ data.GetString("clientPairedSecret", &client_auth_config.pairing_secret);
- protocol::FetchSecretCallback fetch_secret_callback;
if (use_async_pin_dialog_) {
- fetch_secret_callback = base::Bind(
+ client_auth_config.fetch_secret_callback = base::Bind(
&ChromotingInstance::FetchSecretFromDialog, weak_factory_.GetWeakPtr());
} else {
std::string shared_secret;
@@ -606,10 +604,14 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
LOG(ERROR) << "sharedSecret not specified in connect().";
return;
}
- fetch_secret_callback =
+ client_auth_config.fetch_secret_callback =
base::Bind(&ChromotingInstance::FetchSecretFromString, shared_secret);
}
+ client_auth_config.fetch_third_party_token_callback =
+ base::Bind(&ChromotingInstance::FetchThirdPartyToken,
+ weak_factory_.GetWeakPtr(), host_public_key);
+
// Read the list of capabilities, if any.
std::string capabilities;
if (data.HasKey("capabilities")) {
@@ -695,16 +697,6 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
protocol::NetworkSettings::NAT_TRAVERSAL_FULL),
protocol::TransportRole::CLIENT));
- // Create Authenticator.
- protocol::FetchThirdPartyTokenCallback fetch_third_party_token_callback =
- base::Bind(&ChromotingInstance::FetchThirdPartyToken,
- weak_factory_.GetWeakPtr(), host_public_key);
-
- scoped_ptr<protocol::Authenticator> authenticator(
- new protocol::NegotiatingClientAuthenticator(
- client_pairing_id, client_paired_secret, authentication_tag,
- fetch_secret_callback, fetch_third_party_token_callback));
-
scoped_ptr<protocol::CandidateSessionConfig> config =
protocol::CandidateSessionConfig::CreateDefault();
if (std::find(experiments_list.begin(), experiments_list.end(), "vp9") !=
@@ -714,8 +706,8 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
client_->set_protocol_config(std::move(config));
// Kick off the connection.
- client_->Start(signal_strategy_.get(), std::move(authenticator),
- transport_context, host_jid, capabilities);
+ client_->Start(signal_strategy_.get(), client_auth_config, transport_context,
+ host_jid, capabilities);
// Connect the input pipeline to the protocol stub.
mouse_input_filter_.set_input_stub(client_->input_stub());
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.cc ('k') | remoting/protocol/negotiating_authenticator_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698