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 28 matching lines...) Expand all Loading... |
39 const char kTestPairedSecretBad[] = "4444-5555-6666"; | 39 const char kTestPairedSecretBad[] = "4444-5555-6666"; |
40 const char kTestPin[] = "123456"; | 40 const char kTestPin[] = "123456"; |
41 const char kTestPinBad[] = "654321"; | 41 const char kTestPinBad[] = "654321"; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 class NegotiatingAuthenticatorTest : public AuthenticatorTestBase { | 45 class NegotiatingAuthenticatorTest : public AuthenticatorTestBase { |
46 public: | 46 public: |
47 NegotiatingAuthenticatorTest() { | 47 NegotiatingAuthenticatorTest() { |
48 } | 48 } |
49 virtual ~NegotiatingAuthenticatorTest() { | 49 ~NegotiatingAuthenticatorTest() override {} |
50 } | |
51 | 50 |
52 protected: | 51 protected: |
53 void InitAuthenticators( | 52 void InitAuthenticators( |
54 const std::string& client_id, | 53 const std::string& client_id, |
55 const std::string& client_paired_secret, | 54 const std::string& client_paired_secret, |
56 const std::string& client_interactive_pin, | 55 const std::string& client_interactive_pin, |
57 const std::string& host_secret, | 56 const std::string& host_secret, |
58 AuthenticationMethod::HashFunction hash_function, | 57 AuthenticationMethod::HashFunction hash_function, |
59 bool client_hmac_only) { | 58 bool client_hmac_only) { |
60 std::string host_secret_hash = AuthenticationMethod::ApplyHashFunction( | 59 std::string host_secret_hash = AuthenticationMethod::ApplyHashFunction( |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 CreatePairingRegistry(true); | 246 CreatePairingRegistry(true); |
248 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( | 247 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( |
249 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin, | 248 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin, |
250 AuthenticationMethod::HMAC_SHA256, false)); | 249 AuthenticationMethod::HMAC_SHA256, false)); |
251 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); | 250 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); |
252 VerifyRejected(Authenticator::INVALID_CREDENTIALS); | 251 VerifyRejected(Authenticator::INVALID_CREDENTIALS); |
253 } | 252 } |
254 | 253 |
255 } // namespace protocol | 254 } // namespace protocol |
256 } // namespace remoting | 255 } // namespace remoting |
OLD | NEW |