| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |