Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1129)

Side by Side Diff: remoting/protocol/negotiating_authenticator_unittest.cc

Issue 12313085: Host-side third party token validation (Closed) Base URL: http://git.chromium.org/chromium/src.git@third_party_auth_protocol
Patch Set: Add missing parameters Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/negotiating_authenticator.h" 5 #include "remoting/protocol/negotiating_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "remoting/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/authenticator_test_base.h" 10 #include "remoting/protocol/authenticator_test_base.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 protected: 43 protected:
44 void InitAuthenticators( 44 void InitAuthenticators(
45 const std::string& client_secret, 45 const std::string& client_secret,
46 const std::string& host_secret, 46 const std::string& host_secret,
47 AuthenticationMethod::HashFunction hash_function, 47 AuthenticationMethod::HashFunction hash_function,
48 bool client_hmac_only) { 48 bool client_hmac_only) {
49 std::string host_secret_hash = AuthenticationMethod::ApplyHashFunction( 49 std::string host_secret_hash = AuthenticationMethod::ApplyHashFunction(
50 hash_function, kTestHostId, host_secret); 50 hash_function, kTestHostId, host_secret);
51 host_ = NegotiatingAuthenticator::CreateForHost( 51 host_ = NegotiatingAuthenticator::CreateForHostSharedSecret(
52 host_cert_, key_pair_, host_secret_hash, hash_function); 52 host_cert_, key_pair_, host_secret_hash, hash_function);
53 53
54 std::vector<AuthenticationMethod> methods; 54 std::vector<AuthenticationMethod> methods;
55 methods.push_back(AuthenticationMethod::Spake2( 55 methods.push_back(AuthenticationMethod::Spake2(
56 AuthenticationMethod::HMAC_SHA256)); 56 AuthenticationMethod::HMAC_SHA256));
57 if (!client_hmac_only) { 57 if (!client_hmac_only) {
58 methods.push_back(AuthenticationMethod::Spake2( 58 methods.push_back(AuthenticationMethod::Spake2(
59 AuthenticationMethod::NONE)); 59 AuthenticationMethod::NONE));
60 } 60 }
61 client_ = NegotiatingAuthenticator::CreateForClient( 61 client_ = NegotiatingAuthenticator::CreateForClient(
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( 136 ASSERT_NO_FATAL_FAILURE(InitAuthenticators(
137 kTestSharedSecret, kTestSharedSecretBad, 137 kTestSharedSecret, kTestSharedSecretBad,
138 AuthenticationMethod::NONE, true)); 138 AuthenticationMethod::NONE, true));
139 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); 139 ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
140 140
141 VerifyRejected(Authenticator::PROTOCOL_ERROR); 141 VerifyRejected(Authenticator::PROTOCOL_ERROR);
142 } 142 }
143 143
144 } // namespace protocol 144 } // namespace protocol
145 } // namespace remoting 145 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698