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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "net/base/net_errors.h" | 6 #include "net/base/net_errors.h" |
7 #include "remoting/base/rsa_key_pair.h" | 7 #include "remoting/base/rsa_key_pair.h" |
8 #include "remoting/protocol/authenticator_test_base.h" | 8 #include "remoting/protocol/authenticator_test_base.h" |
9 #include "remoting/protocol/channel_authenticator.h" | 9 #include "remoting/protocol/channel_authenticator.h" |
10 #include "remoting/protocol/connection_tester.h" | 10 #include "remoting/protocol/connection_tester.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 pairing_registry); | 62 pairing_registry); |
63 | 63 |
64 std::vector<AuthenticationMethod> methods; | 64 std::vector<AuthenticationMethod> methods; |
65 methods.push_back(AuthenticationMethod::Spake2Pair()); | 65 methods.push_back(AuthenticationMethod::Spake2Pair()); |
66 methods.push_back(AuthenticationMethod::Spake2( | 66 methods.push_back(AuthenticationMethod::Spake2( |
67 AuthenticationMethod::HMAC_SHA256)); | 67 AuthenticationMethod::HMAC_SHA256)); |
68 if (!client_hmac_only) { | 68 if (!client_hmac_only) { |
69 methods.push_back(AuthenticationMethod::Spake2( | 69 methods.push_back(AuthenticationMethod::Spake2( |
70 AuthenticationMethod::NONE)); | 70 AuthenticationMethod::NONE)); |
71 } | 71 } |
72 bool pairing_expected = pairing_registry != NULL; | 72 bool pairing_expected = pairing_registry.get() != NULL; |
73 FetchSecretCallback fetch_secret_callback = base::Bind( | 73 FetchSecretCallback fetch_secret_callback = |
74 &NegotiatingAuthenticatorTest::FetchSecret, | 74 base::Bind(&NegotiatingAuthenticatorTest::FetchSecret, |
75 client_interactive_pin, pairing_expected); | 75 client_interactive_pin, |
| 76 pairing_expected); |
76 client_as_negotiating_authenticator_ = new NegotiatingClientAuthenticator( | 77 client_as_negotiating_authenticator_ = new NegotiatingClientAuthenticator( |
77 client_id, client_paired_secret, | 78 client_id, client_paired_secret, |
78 kTestHostId, fetch_secret_callback, | 79 kTestHostId, fetch_secret_callback, |
79 scoped_ptr<ThirdPartyClientAuthenticator::TokenFetcher>(), methods); | 80 scoped_ptr<ThirdPartyClientAuthenticator::TokenFetcher>(), methods); |
80 client_.reset(client_as_negotiating_authenticator_); | 81 client_.reset(client_as_negotiating_authenticator_); |
81 } | 82 } |
82 | 83 |
83 scoped_refptr<PairingRegistry> CreatePairingRegistry( | 84 scoped_refptr<PairingRegistry> CreatePairingRegistry( |
84 PairingRegistry::Pairing* pairings, size_t num_pairings) { | 85 PairingRegistry::Pairing* pairings, size_t num_pairings) { |
85 PairingRegistry::PairedClients clients; | 86 PairingRegistry::PairedClients clients; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( | 255 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( |
255 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin, | 256 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin, |
256 AuthenticationMethod::HMAC_SHA256, false, | 257 AuthenticationMethod::HMAC_SHA256, false, |
257 CreatePairingRegistry(&pairing, 1))); | 258 CreatePairingRegistry(&pairing, 1))); |
258 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); | 259 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); |
259 VerifyRejected(Authenticator::INVALID_CREDENTIALS); | 260 VerifyRejected(Authenticator::INVALID_CREDENTIALS); |
260 } | 261 } |
261 | 262 |
262 } // namespace protocol | 263 } // namespace protocol |
263 } // namespace remoting | 264 } // namespace remoting |
OLD | NEW |