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 <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "remoting/base/rsa_key_pair.h" | 13 #include "remoting/base/rsa_key_pair.h" |
14 #include "remoting/protocol/negotiating_host_authenticator.h" | 14 #include "remoting/protocol/negotiating_host_authenticator.h" |
15 #include "remoting/protocol/validating_authenticator.h" | 15 #include "remoting/protocol/validating_authenticator.h" |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 namespace protocol { | 18 namespace protocol { |
19 | 19 |
20 It2MeHostAuthenticatorFactory::It2MeHostAuthenticatorFactory( | 20 It2MeHostAuthenticatorFactory::It2MeHostAuthenticatorFactory( |
21 const std::string& local_cert, | 21 const std::string& local_cert, |
22 scoped_refptr<RsaKeyPair> key_pair, | 22 scoped_refptr<RsaKeyPair> key_pair, |
23 const std::string& access_code_hash, | 23 const std::string& access_code_hash, |
24 const ValidatingAuthenticator::ValidationCallback& callback) | 24 const ValidatingAuthenticator::ValidationCallback& incoming_callback, |
| 25 const ValidatingAuthenticator::ValidationCallback& accepted_callback) |
25 : local_cert_(local_cert), | 26 : local_cert_(local_cert), |
26 key_pair_(key_pair), | 27 key_pair_(key_pair), |
27 access_code_hash_(access_code_hash), | 28 access_code_hash_(access_code_hash), |
28 validation_callback_(callback) {} | 29 incoming_callback_(incoming_callback), |
| 30 accepted_callback_(accepted_callback) {} |
29 | 31 |
30 It2MeHostAuthenticatorFactory::~It2MeHostAuthenticatorFactory() {} | 32 It2MeHostAuthenticatorFactory::~It2MeHostAuthenticatorFactory() {} |
31 | 33 |
32 std::unique_ptr<Authenticator> | 34 std::unique_ptr<Authenticator> |
33 It2MeHostAuthenticatorFactory::CreateAuthenticator( | 35 It2MeHostAuthenticatorFactory::CreateAuthenticator( |
34 const std::string& local_jid, | 36 const std::string& local_jid, |
35 const std::string& remote_jid) { | 37 const std::string& remote_jid) { |
36 std::unique_ptr<Authenticator> authenticator( | 38 std::unique_ptr<Authenticator> authenticator( |
37 NegotiatingHostAuthenticator::CreateWithSharedSecret( | 39 NegotiatingHostAuthenticator::CreateWithSharedSecret( |
38 local_jid, remote_jid, local_cert_, key_pair_, access_code_hash_, | 40 local_jid, remote_jid, local_cert_, key_pair_, access_code_hash_, |
39 nullptr)); | 41 nullptr)); |
40 | 42 |
41 return base::MakeUnique<ValidatingAuthenticator>( | 43 return base::MakeUnique<ValidatingAuthenticator>( |
42 remote_jid, validation_callback_, std::move(authenticator)); | 44 remote_jid, incoming_callback_, accepted_callback_, |
| 45 std::move(authenticator)); |
43 } | 46 } |
44 | 47 |
45 } // namespace protocol | 48 } // namespace protocol |
46 } // namespace remoting | 49 } // namespace remoting |
OLD | NEW |