OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <cstring> | 5 #include <cstring> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 return std::move(http_response); | 274 return std::move(http_response); |
275 } | 275 } |
276 | 276 |
277 // A FakeCryptohomeClient that stores the salted and hashed secret passed to | 277 // A FakeCryptohomeClient that stores the salted and hashed secret passed to |
278 // MountEx(). | 278 // MountEx(). |
279 class SecretInterceptingFakeCryptohomeClient : public FakeCryptohomeClient { | 279 class SecretInterceptingFakeCryptohomeClient : public FakeCryptohomeClient { |
280 public: | 280 public: |
281 SecretInterceptingFakeCryptohomeClient(); | 281 SecretInterceptingFakeCryptohomeClient(); |
282 | 282 |
283 void MountEx(const cryptohome::AccountIdentifier& id, | 283 void MountEx(const cryptohome::Identification& id, |
284 const cryptohome::AuthorizationRequest& auth, | 284 const cryptohome::AuthorizationRequest& auth, |
285 const cryptohome::MountRequest& request, | 285 const cryptohome::MountRequest& request, |
286 const ProtobufMethodCallback& callback) override; | 286 const ProtobufMethodCallback& callback) override; |
287 | 287 |
288 const std::string& salted_hashed_secret() { return salted_hashed_secret_; } | 288 const std::string& salted_hashed_secret() { return salted_hashed_secret_; } |
289 | 289 |
290 private: | 290 private: |
291 std::string salted_hashed_secret_; | 291 std::string salted_hashed_secret_; |
292 | 292 |
293 DISALLOW_COPY_AND_ASSIGN(SecretInterceptingFakeCryptohomeClient); | 293 DISALLOW_COPY_AND_ASSIGN(SecretInterceptingFakeCryptohomeClient); |
294 }; | 294 }; |
295 | 295 |
296 SecretInterceptingFakeCryptohomeClient:: | 296 SecretInterceptingFakeCryptohomeClient:: |
297 SecretInterceptingFakeCryptohomeClient() { | 297 SecretInterceptingFakeCryptohomeClient() { |
298 } | 298 } |
299 | 299 |
300 void SecretInterceptingFakeCryptohomeClient::MountEx( | 300 void SecretInterceptingFakeCryptohomeClient::MountEx( |
301 const cryptohome::AccountIdentifier& id, | 301 const cryptohome::Identification& id, |
302 const cryptohome::AuthorizationRequest& auth, | 302 const cryptohome::AuthorizationRequest& auth, |
303 const cryptohome::MountRequest& request, | 303 const cryptohome::MountRequest& request, |
304 const ProtobufMethodCallback& callback) { | 304 const ProtobufMethodCallback& callback) { |
305 salted_hashed_secret_ = auth.key().secret(); | 305 salted_hashed_secret_ = auth.key().secret(); |
306 FakeCryptohomeClient::MountEx(id, auth, request, callback); | 306 FakeCryptohomeClient::MountEx(id, auth, request, callback); |
307 } | 307 } |
308 | 308 |
309 } // namespace | 309 } // namespace |
310 | 310 |
311 class SamlTest : public OobeBaseTest { | 311 class SamlTest : public OobeBaseTest { |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 kTestAuthLSIDCookie1); | 1236 kTestAuthLSIDCookie1); |
1237 | 1237 |
1238 GetCookies(); | 1238 GetCookies(); |
1239 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); | 1239 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
1240 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); | 1240 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); |
1241 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); | 1241 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); |
1242 } | 1242 } |
1243 | 1243 |
1244 | 1244 |
1245 } // namespace chromeos | 1245 } // namespace chromeos |
OLD | NEW |