| 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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "remoting/host/service_urls.h" | 64 #include "remoting/host/service_urls.h" |
| 65 #include "remoting/host/session_manager_factory.h" | 65 #include "remoting/host/session_manager_factory.h" |
| 66 #include "remoting/host/signaling_connector.h" | 66 #include "remoting/host/signaling_connector.h" |
| 67 #include "remoting/host/token_validator_factory_impl.h" | 67 #include "remoting/host/token_validator_factory_impl.h" |
| 68 #include "remoting/host/usage_stats_consent.h" | 68 #include "remoting/host/usage_stats_consent.h" |
| 69 #include "remoting/host/username.h" | 69 #include "remoting/host/username.h" |
| 70 #include "remoting/jingle_glue/network_settings.h" | 70 #include "remoting/jingle_glue/network_settings.h" |
| 71 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 71 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 72 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 72 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
| 73 #include "remoting/protocol/pairing_registry.h" | 73 #include "remoting/protocol/pairing_registry.h" |
| 74 #include "remoting/protocol/token_validator.h" |
| 74 | 75 |
| 75 #if defined(OS_POSIX) | 76 #if defined(OS_POSIX) |
| 76 #include <signal.h> | 77 #include <signal.h> |
| 77 #include <sys/types.h> | 78 #include <sys/types.h> |
| 78 #include <unistd.h> | 79 #include <unistd.h> |
| 79 #include "base/file_descriptor_posix.h" | 80 #include "base/file_descriptor_posix.h" |
| 80 #include "remoting/host/pam_authorization_factory_posix.h" | 81 #include "remoting/host/pam_authorization_factory_posix.h" |
| 81 #include "remoting/host/posix/signal_handler.h" | 82 #include "remoting/host/posix/signal_handler.h" |
| 82 #endif // defined(OS_POSIX) | 83 #endif // defined(OS_POSIX) |
| 83 | 84 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 } | 544 } |
| 544 | 545 |
| 545 scoped_ptr<protocol::AuthenticatorFactory> factory; | 546 scoped_ptr<protocol::AuthenticatorFactory> factory; |
| 546 | 547 |
| 547 if (third_party_auth_config_.is_empty()) { | 548 if (third_party_auth_config_.is_empty()) { |
| 548 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( | 549 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( |
| 549 use_service_account_, host_owner_, local_certificate, key_pair_, | 550 use_service_account_, host_owner_, local_certificate, key_pair_, |
| 550 host_secret_hash_, pairing_registry); | 551 host_secret_hash_, pairing_registry); |
| 551 | 552 |
| 552 } else if (third_party_auth_config_.is_valid()) { | 553 } else if (third_party_auth_config_.is_valid()) { |
| 553 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> | 554 scoped_ptr<protocol::TokenValidatorFactory> token_validator_factory( |
| 554 token_validator_factory(new TokenValidatorFactoryImpl( | 555 new TokenValidatorFactoryImpl( |
| 555 third_party_auth_config_, | 556 third_party_auth_config_, |
| 556 key_pair_, context_->url_request_context_getter())); | 557 key_pair_, context_->url_request_context_getter())); |
| 557 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( | 558 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( |
| 558 use_service_account_, host_owner_, local_certificate, key_pair_, | 559 use_service_account_, host_owner_, local_certificate, key_pair_, |
| 559 token_validator_factory.Pass()); | 560 token_validator_factory.Pass()); |
| 560 | 561 |
| 561 } else { | 562 } else { |
| 562 // TODO(rmsousa): If the policy is bad the host should not go online. It | 563 // TODO(rmsousa): If the policy is bad the host should not go online. It |
| 563 // should keep running, but not connected, until the policies are fixed. | 564 // should keep running, but not connected, until the policies are fixed. |
| 564 // Having it show up as online and then reject all clients is misleading. | 565 // Having it show up as online and then reject all clients is misleading. |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 return exit_code; | 1278 return exit_code; |
| 1278 } | 1279 } |
| 1279 | 1280 |
| 1280 } // namespace remoting | 1281 } // namespace remoting |
| 1281 | 1282 |
| 1282 #if !defined(OS_WIN) | 1283 #if !defined(OS_WIN) |
| 1283 int main(int argc, char** argv) { | 1284 int main(int argc, char** argv) { |
| 1284 return remoting::HostMain(argc, argv); | 1285 return remoting::HostMain(argc, argv); |
| 1285 } | 1286 } |
| 1286 #endif // !defined(OS_WIN) | 1287 #endif // !defined(OS_WIN) |
| OLD | NEW |