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

Unified Diff: remoting/host/chromoting_host.cc

Issue 8764012: Set empty shared secret for Me2Me hosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 1 month 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/chromoting_host.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index f3d96122934b849426ea375a8cbd501a2f19631f..dcd5b77439a11d47266dcb00214039c355c700d2 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -48,6 +48,7 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context,
desktop_environment_(environment),
config_(config),
allow_nat_traversal_(allow_nat_traversal),
+ have_shared_secret_(false),
stopping_recorders_(0),
state_(kInitial),
protocol_config_(protocol::CandidateSessionConfig::CreateDefault()),
@@ -134,6 +135,7 @@ void ChromotingHost::Shutdown(const base::Closure& shutdown_task) {
// deletion.
context_->network_message_loop()->DeleteSoon(
FROM_HERE, session_manager_.release());
+ have_shared_secret_ = false;
}
// Stop XMPP connection synchronously.
@@ -161,10 +163,14 @@ void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) {
void ChromotingHost::SetSharedSecret(const std::string& shared_secret) {
DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
- session_manager_->set_authenticator_factory(
- new protocol::V1HostAuthenticatorFactory(
- key_pair_.GenerateCertificate(), key_pair_.private_key(),
- shared_secret));
+ shared_secret_ = shared_secret;
+ have_shared_secret_ = true;
+ if (session_manager_.get()) {
+ session_manager_->set_authenticator_factory(
+ new protocol::V1HostAuthenticatorFactory(
+ key_pair_.GenerateCertificate(), key_pair_.private_key(),
+ shared_secret_));
+ }
}
////////////////////////////////////////////////////////////////////////////
@@ -266,6 +272,12 @@ void ChromotingHost::OnStateChange(
this, allow_nat_traversal_);
session_manager_.reset(server);
+ if (have_shared_secret_) {
+ session_manager_->set_authenticator_factory(
+ new protocol::V1HostAuthenticatorFactory(
+ key_pair_.GenerateCertificate(), key_pair_.private_key(),
+ shared_secret_));
+ }
for (StatusObserverList::iterator it = status_observers_.begin();
it != status_observers_.end(); ++it) {
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698