Commit df644193 authored by sergeyu's avatar sergeyu Committed by Commit bot

Normalize JIDs passed to Spake2Authenticator.

Spake2Authenticator requires that local_id and remote_id are the same
on both ends of the connection, so JIDs need to be normalized to avoid
issues when one of the ends gets JID in a different case.

BUG=589698

Review URL: https://codereview.chromium.org/1803893002

Cr-Commit-Position: refs/heads/master@{#381559}
parent b9bf377e
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "remoting/protocol/transport_context.h" #include "remoting/protocol/transport_context.h"
#include "remoting/protocol/video_renderer.h" #include "remoting/protocol/video_renderer.h"
#include "remoting/protocol/webrtc_connection_to_host.h" #include "remoting/protocol/webrtc_connection_to_host.h"
#include "remoting/signaling/jid_util.h"
namespace remoting { namespace remoting {
...@@ -61,7 +62,7 @@ void ChromotingClient::Start( ...@@ -61,7 +62,7 @@ void ChromotingClient::Start(
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!session_manager_); // Start must be called more than once. DCHECK(!session_manager_); // Start must be called more than once.
host_jid_ = host_jid; host_jid_ = NormalizeJid(host_jid);
local_capabilities_ = capabilities; local_capabilities_ = capabilities;
if (!protocol_config_) if (!protocol_config_)
...@@ -216,7 +217,7 @@ void ChromotingClient::StartConnection() { ...@@ -216,7 +217,7 @@ void ChromotingClient::StartConnection() {
session_manager_->Connect( session_manager_->Connect(
host_jid_, host_jid_,
make_scoped_ptr(new protocol::NegotiatingClientAuthenticator( make_scoped_ptr(new protocol::NegotiatingClientAuthenticator(
signal_strategy_->GetLocalJid(), host_jid_, NormalizeJid(signal_strategy_->GetLocalJid()), host_jid_,
client_auth_config_))), client_auth_config_))),
transport_context_, this); transport_context_, this);
} }
......
...@@ -116,15 +116,18 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator( ...@@ -116,15 +116,18 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator(
} }
if (!local_cert_.empty() && key_pair_.get()) { if (!local_cert_.empty() && key_pair_.get()) {
std::string normalized_local_jid = NormalizeJid(local_jid);
std::string normalized_remote_jid = NormalizeJid(remote_jid);
if (token_validator_factory_) { if (token_validator_factory_) {
return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth(
local_jid, remote_jid, local_cert_, key_pair_, normalized_local_jid, normalized_remote_jid, local_cert_, key_pair_,
token_validator_factory_); token_validator_factory_);
} }
return NegotiatingHostAuthenticator::CreateWithPin( return NegotiatingHostAuthenticator::CreateWithPin(
local_jid, remote_jid, local_cert_, key_pair_, pin_hash_, normalized_local_jid, normalized_remote_jid, local_cert_, key_pair_,
pairing_registry_); pin_hash_, pairing_registry_);
} }
return make_scoped_ptr( return make_scoped_ptr(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment