diff options
author | sergeyu <sergeyu@chromium.org> | 2016-03-11 15:17:38 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-11 23:18:57 +0000 |
commit | 279bf7c76a3e0bfbbd28748d0d02fcead88f4436 (patch) | |
tree | 90bc84a17c2dabe9c107aa797c18a4daaf956629 /remoting/test | |
parent | 3bb5509ec38c488f920abcab47d30154cdebe58c (diff) | |
download | chromium_src-279bf7c76a3e0bfbbd28748d0d02fcead88f4436.zip chromium_src-279bf7c76a3e0bfbbd28748d0d02fcead88f4436.tar.gz chromium_src-279bf7c76a3e0bfbbd28748d0d02fcead88f4436.tar.bz2 |
Move NegotiatingClientAuthentication creation to ChromotingClient.
For the new SPAKE2 authenticator we need to pass client_jid
to the authenticator. This wasn't possible previously because
NegotiatingClientAuthenticator was created before signaling is
connected. Moved NegotiatingClientAuthentication creation to
ChromotingClient.
BUG=589698
Review URL: https://codereview.chromium.org/1778023002
Cr-Commit-Position: refs/heads/master@{#380779}
Diffstat (limited to 'remoting/test')
-rw-r--r-- | remoting/test/protocol_perftest.cc | 14 | ||||
-rw-r--r-- | remoting/test/test_chromoting_client.cc | 28 |
2 files changed, 19 insertions, 23 deletions
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc index cfbe304..d8a9643 100644 --- a/remoting/test/protocol_perftest.cc +++ b/remoting/test/protocol_perftest.cc @@ -388,17 +388,15 @@ class ProtocolPerfTest host_signaling_.get(), std::move(port_allocator_factory), nullptr, network_settings, protocol::TransportRole::CLIENT)); - scoped_ptr<protocol::Authenticator> client_authenticator( - new protocol::NegotiatingClientAuthenticator( - std::string(), // client_pairing_id - std::string(), // client_pairing_secret - kHostId, - base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)), - protocol::FetchThirdPartyTokenCallback())); + protocol::ClientAuthenticationConfig client_auth_config; + client_auth_config.host_id = kHostId; + client_auth_config.fetch_secret_callback = + base::Bind(&ProtocolPerfTest::FetchPin, base::Unretained(this)); + client_.reset( new ChromotingClient(client_context_.get(), this, this, nullptr)); client_->set_protocol_config(protocol_config_->Clone()); - client_->Start(client_signaling_.get(), std::move(client_authenticator), + client_->Start(client_signaling_.get(), client_auth_config, transport_context, kHostJid, std::string()); } diff --git a/remoting/test/test_chromoting_client.cc b/remoting/test/test_chromoting_client.cc index 917980c..9bc33ca 100644 --- a/remoting/test/test_chromoting_client.cc +++ b/remoting/test/test_chromoting_client.cc @@ -126,25 +126,23 @@ void TestChromotingClient::StartConnection( new ChromiumUrlRequestFactory(request_context_getter)), network_settings, protocol::TransportRole::CLIENT)); - protocol::FetchSecretCallback fetch_secret_callback; + protocol::ClientAuthenticationConfig client_auth_config; + client_auth_config.host_id = connection_setup_info.host_id; + client_auth_config.pairing_client_id = connection_setup_info.pairing_id; + client_auth_config.pairing_secret = connection_setup_info.shared_secret; + if (!connection_setup_info.pin.empty()) { - fetch_secret_callback = base::Bind(&FetchSecret, connection_setup_info.pin); + client_auth_config.fetch_secret_callback = + base::Bind(&FetchSecret, connection_setup_info.pin); } - protocol::FetchThirdPartyTokenCallback fetch_third_party_token_callback = - base::Bind(&FetchThirdPartyToken, - connection_setup_info.authorization_code, - connection_setup_info.shared_secret); - - scoped_ptr<protocol::Authenticator> authenticator( - new protocol::NegotiatingClientAuthenticator( - connection_setup_info.pairing_id, connection_setup_info.shared_secret, - connection_setup_info.host_id, fetch_secret_callback, - fetch_third_party_token_callback)); + client_auth_config.fetch_third_party_token_callback = base::Bind( + &FetchThirdPartyToken, connection_setup_info.authorization_code, + connection_setup_info.shared_secret); - chromoting_client_->Start( - signal_strategy_.get(), std::move(authenticator), transport_context, - connection_setup_info.host_jid, connection_setup_info.capabilities); + chromoting_client_->Start(signal_strategy_.get(), client_auth_config, + transport_context, connection_setup_info.host_jid, + connection_setup_info.capabilities); } void TestChromotingClient::EndConnection() { |