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

Unified Diff: remoting/jingle_glue/xmpp_signal_strategy.cc

Issue 10388226: This broke M20 build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/host/simple_host_process.cc ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/xmpp_signal_strategy.cc
===================================================================
--- remoting/jingle_glue/xmpp_signal_strategy.cc (revision 138203)
+++ remoting/jingle_glue/xmpp_signal_strategy.cc (working copy)
@@ -167,6 +167,24 @@
DCHECK(CalledOnValidThread());
if (state == buzz::XmppEngine::STATE_OPEN) {
+ // Verify that the JID that we've received matches the username
+ // that we have. If it doesn't, then the OAuth token was probably
+ // issued for a different account, so we treat is a an auth error.
+ //
+ // TODO(sergeyu): Some user accounts may not have associated
+ // e-mail address. The check below will fail for such
+ // accounts. Make sure we can handle this case proprely.
+ if (!StartsWithASCII(GetLocalJid(), username_, false)) {
+ LOG(ERROR) << "Received JID that is different from the expected value.";
+ error_ = AUTHENTICATION_FAILED;
+ xmpp_client_->SignalStateChange.disconnect(this);
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&DisconnectXmppClient, xmpp_client_));
+ xmpp_client_ = NULL;
+ SetState(DISCONNECTED);
+ return;
+ }
+
keep_alive_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kKeepAliveIntervalSeconds),
this, &XmppSignalStrategy::SendKeepAlive);
« no previous file with comments | « remoting/host/simple_host_process.cc ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698