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

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

Issue 1987163002: Add DOMAIN_MISMATCH message end to end (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO in Jingle session Created 4 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/errors.cc ('k') | remoting/protocol/jingle_messages.h » ('j') | 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/it2me_host_authenticator_factory.h" 5 #include "remoting/protocol/it2me_host_authenticator_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "remoting/base/rsa_key_pair.h" 10 #include "remoting/base/rsa_key_pair.h"
(...skipping 25 matching lines...) Expand all
36 size_t pos = client_username.find('/'); 36 size_t pos = client_username.find('/');
37 if (pos != std::string::npos) { 37 if (pos != std::string::npos) {
38 client_username.replace(pos, std::string::npos, ""); 38 client_username.replace(pos, std::string::npos, "");
39 } 39 }
40 if (!base::EndsWith(client_username, 40 if (!base::EndsWith(client_username,
41 std::string("@") + required_client_domain_, 41 std::string("@") + required_client_domain_,
42 base::CompareCase::INSENSITIVE_ASCII)) { 42 base::CompareCase::INSENSITIVE_ASCII)) {
43 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid 43 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid
44 << ": Domain mismatch."; 44 << ": Domain mismatch.";
45 return base::WrapUnique( 45 return base::WrapUnique(
46 new RejectingAuthenticator(Authenticator::INVALID_CREDENTIALS)); 46 new RejectingAuthenticator(Authenticator::INVALID_ACCOUNT));
47 } 47 }
48 } 48 }
49 49
50 return NegotiatingHostAuthenticator::CreateWithSharedSecret( 50 return NegotiatingHostAuthenticator::CreateWithSharedSecret(
51 local_jid, remote_jid, local_cert_, key_pair_, access_code_hash_, 51 local_jid, remote_jid, local_cert_, key_pair_, access_code_hash_,
52 nullptr); 52 nullptr);
53 } 53 }
54 54
55 } // namespace protocol 55 } // namespace protocol
56 } // namespace remoting 56 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/errors.cc ('k') | remoting/protocol/jingle_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698