OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/negotiating_host_authenticator.h" | 5 #include "remoting/protocol/negotiating_host_authenticator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 const std::string& local_cert, | 34 const std::string& local_cert, |
35 scoped_refptr<RsaKeyPair> key_pair, | 35 scoped_refptr<RsaKeyPair> key_pair, |
36 const std::string& shared_secret_hash, | 36 const std::string& shared_secret_hash, |
37 AuthenticationMethod::HashFunction hash_function, | 37 AuthenticationMethod::HashFunction hash_function, |
38 scoped_refptr<PairingRegistry> pairing_registry) { | 38 scoped_refptr<PairingRegistry> pairing_registry) { |
39 scoped_ptr<NegotiatingHostAuthenticator> result( | 39 scoped_ptr<NegotiatingHostAuthenticator> result( |
40 new NegotiatingHostAuthenticator(local_cert, key_pair)); | 40 new NegotiatingHostAuthenticator(local_cert, key_pair)); |
41 result->shared_secret_hash_ = shared_secret_hash; | 41 result->shared_secret_hash_ = shared_secret_hash; |
42 result->pairing_registry_ = pairing_registry; | 42 result->pairing_registry_ = pairing_registry; |
43 result->AddMethod(AuthenticationMethod::Spake2(hash_function)); | 43 result->AddMethod(AuthenticationMethod::Spake2(hash_function)); |
44 if (pairing_registry) { | 44 if (pairing_registry.get()) { |
45 result->AddMethod(AuthenticationMethod::Spake2Pair()); | 45 result->AddMethod(AuthenticationMethod::Spake2Pair()); |
46 } | 46 } |
47 return scoped_ptr<Authenticator>(result.Pass()); | 47 return scoped_ptr<Authenticator>(result.Pass()); |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 scoped_ptr<Authenticator> | 51 scoped_ptr<Authenticator> |
52 NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( | 52 NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( |
53 const std::string& local_cert, | 53 const std::string& local_cert, |
54 scoped_refptr<RsaKeyPair> key_pair, | 54 scoped_refptr<RsaKeyPair> key_pair, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 current_method_.type() == AuthenticationMethod::SPAKE2_PAIR); | 180 current_method_.type() == AuthenticationMethod::SPAKE2_PAIR); |
181 current_authenticator_ = V2Authenticator::CreateForHost( | 181 current_authenticator_ = V2Authenticator::CreateForHost( |
182 local_cert_, local_key_pair_, shared_secret_hash_, | 182 local_cert_, local_key_pair_, shared_secret_hash_, |
183 preferred_initial_state); | 183 preferred_initial_state); |
184 } | 184 } |
185 resume_callback.Run(); | 185 resume_callback.Run(); |
186 } | 186 } |
187 | 187 |
188 } // namespace protocol | 188 } // namespace protocol |
189 } // namespace remoting | 189 } // namespace remoting |
OLD | NEW |