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

Side by Side Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 1803893002: Normalize JIDs passed to Spake2Authenticator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/client/chromoting_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/me2me_host_authenticator_factory.h" 5 #include "remoting/protocol/me2me_host_authenticator_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 std::string("@") + required_client_domain_, 109 std::string("@") + required_client_domain_,
110 base::CompareCase::INSENSITIVE_ASCII)) { 110 base::CompareCase::INSENSITIVE_ASCII)) {
111 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid 111 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid
112 << ": Domain mismatch."; 112 << ": Domain mismatch.";
113 return make_scoped_ptr( 113 return make_scoped_ptr(
114 new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS)); 114 new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
115 } 115 }
116 } 116 }
117 117
118 if (!local_cert_.empty() && key_pair_.get()) { 118 if (!local_cert_.empty() && key_pair_.get()) {
119 std::string normalized_local_jid = NormalizeJid(local_jid);
120 std::string normalized_remote_jid = NormalizeJid(remote_jid);
121
119 if (token_validator_factory_) { 122 if (token_validator_factory_) {
120 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( 123 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth(
121 local_jid, remote_jid, local_cert_, key_pair_, 124 normalized_local_jid, normalized_remote_jid, local_cert_, key_pair_,
122 token_validator_factory_); 125 token_validator_factory_);
123 } 126 }
124 127
125 return NegotiatingHostAuthenticator::CreateWithPin( 128 return NegotiatingHostAuthenticator::CreateWithPin(
126 local_jid, remote_jid, local_cert_, key_pair_, pin_hash_, 129 normalized_local_jid, normalized_remote_jid, local_cert_, key_pair_,
127 pairing_registry_); 130 pin_hash_, pairing_registry_);
128 } 131 }
129 132
130 return make_scoped_ptr( 133 return make_scoped_ptr(
131 new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS)); 134 new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS));
132 } 135 }
133 136
134 } // namespace protocol 137 } // namespace protocol
135 } // namespace remoting 138 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/chromoting_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698