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 "chromeos/login/auth/extended_authenticator.h" | 5 #include "chromeos/login/auth/extended_authenticator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chromeos/cryptohome/async_method_caller.h" | 10 #include "chromeos/cryptohome/async_method_caller.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 RecordStartMarker("MountEx"); | 82 RecordStartMarker("MountEx"); |
83 | 83 |
84 std::string canonicalized = gaia::CanonicalizeEmail(user_id); | 84 std::string canonicalized = gaia::CanonicalizeEmail(user_id); |
85 cryptohome::Identification id(canonicalized); | 85 cryptohome::Identification id(canonicalized); |
86 cryptohome::Authorization auth(keys.front()); | 86 cryptohome::Authorization auth(keys.front()); |
87 cryptohome::MountParameters mount(false); | 87 cryptohome::MountParameters mount(false); |
88 for (size_t i = 0; i < keys.size(); i++) { | 88 for (size_t i = 0; i < keys.size(); i++) { |
89 mount.create_keys.push_back(keys[i]); | 89 mount.create_keys.push_back(keys[i]); |
90 } | 90 } |
91 UserContext context(user_id); | 91 UserContext context(user_id); |
92 Key key(keys.front().key); | 92 Key key(keys.front().secret); |
93 key.SetLabel(keys.front().label); | 93 key.SetLabel(keys.front().label); |
94 context.SetKey(key); | 94 context.SetKey(key); |
95 | 95 |
96 cryptohome::HomedirMethods::GetInstance()->MountEx( | 96 cryptohome::HomedirMethods::GetInstance()->MountEx( |
97 id, | 97 id, |
98 auth, | 98 auth, |
99 mount, | 99 mount, |
100 base::Bind(&ExtendedAuthenticator::OnMountComplete, | 100 base::Bind(&ExtendedAuthenticator::OnMountComplete, |
101 this, | 101 this, |
102 "MountEx", | 102 "MountEx", |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (consumer_) | 352 if (consumer_) |
353 consumer_->OnAuthenticationFailure(state); | 353 consumer_->OnAuthenticationFailure(state); |
354 | 354 |
355 if (old_consumer_) { | 355 if (old_consumer_) { |
356 AuthFailure failure(AuthFailure::UNLOCK_FAILED); | 356 AuthFailure failure(AuthFailure::UNLOCK_FAILED); |
357 old_consumer_->OnAuthFailure(failure); | 357 old_consumer_->OnAuthFailure(failure); |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 } // namespace chromeos | 361 } // namespace chromeos |
OLD | NEW |