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

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: Cache parameter of SetSharedSecret() and use it when session manager is created. 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 1e958cc6aee81e45599d3cbe0f609f4f764bc3dc..4b6cf904363afd78f2e6e3a97cca0a24cd7175ab 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -49,6 +49,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()),
@@ -136,6 +137,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.
@@ -163,10 +165,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_));
+ }
}
////////////////////////////////////////////////////////////////////////////
@@ -278,6 +284,12 @@ void ChromotingHost::OnStateChange(
this, allow_nat_traversal_);
session_manager_.reset(server);
+ if (have_shared_secret_) {
Sergey Ulanov 2011/12/01 21:10:13 nit: I don't think we need this flag. !shared_secr
Lambros 2011/12/01 21:29:21 !shared_secret_.empty() wouldn't work. remoting_m
+ 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