OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" | 5 #include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return result; | 109 return result; |
110 | 110 |
111 if (user_schema == SCHEMA_SALT_HASHED) { | 111 if (user_schema == SCHEMA_SALT_HASHED) { |
112 base::DictionaryValue holder; | 112 base::DictionaryValue holder; |
113 std::string salt; | 113 std::string salt; |
114 owner_->GetPasswordInformation(context.GetUserID(), &holder); | 114 owner_->GetPasswordInformation(context.GetUserID(), &holder); |
115 holder.GetStringWithoutPathExpansion(kSalt, &salt); | 115 holder.GetStringWithoutPathExpansion(kSalt, &salt); |
116 DCHECK(!salt.empty()); | 116 DCHECK(!salt.empty()); |
117 Key* const key = result.GetKey(); | 117 Key* const key = result.GetKey(); |
118 key->Transform(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, salt); | 118 key->Transform(Key::KEY_TYPE_SALTED_PBKDF2_AES256_1234, salt); |
119 key->SetLabel(kCryptohomeManagedUserKeyLabel); | 119 key->SetLabel(kCryptohomeSupervisedUserKeyLabel); |
120 result.SetIsUsingOAuth(false); | 120 result.SetIsUsingOAuth(false); |
121 return result; | 121 return result; |
122 } | 122 } |
123 NOTREACHED() << "Unknown password schema for " << context.GetUserID(); | 123 NOTREACHED() << "Unknown password schema for " << context.GetUserID(); |
124 return context; | 124 return context; |
125 } | 125 } |
126 | 126 |
127 bool SupervisedUserAuthentication::FillDataForNewUser( | 127 bool SupervisedUserAuthentication::FillDataForNewUser( |
128 const std::string& user_id, | 128 const std::string& user_id, |
129 const std::string& password, | 129 const std::string& password, |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 LOG(FATAL) << "HMAC::Sign failed"; | 312 LOG(FATAL) << "HMAC::Sign failed"; |
313 | 313 |
314 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); | 314 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); |
315 | 315 |
316 std::string result; | 316 std::string result; |
317 base::Base64Encode(raw_result, &result); | 317 base::Base64Encode(raw_result, &result); |
318 return result; | 318 return result; |
319 } | 319 } |
320 | 320 |
321 } // namespace chromeos | 321 } // namespace chromeos |
OLD | NEW |