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 "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.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_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 sizeof(master_key_bytes))); | 171 sizeof(master_key_bytes))); |
172 } | 172 } |
173 | 173 |
174 void SupervisedUserAuthentication::StorePasswordData( | 174 void SupervisedUserAuthentication::StorePasswordData( |
175 const std::string& user_id, | 175 const std::string& user_id, |
176 const base::DictionaryValue& password_data) { | 176 const base::DictionaryValue& password_data) { |
177 base::DictionaryValue holder; | 177 base::DictionaryValue holder; |
178 owner_->GetPasswordInformation(user_id, &holder); | 178 owner_->GetPasswordInformation(user_id, &holder); |
179 const base::Value* value; | 179 const base::Value* value; |
180 if (password_data.GetWithoutPathExpansion(kSchemaVersion, &value)) | 180 if (password_data.GetWithoutPathExpansion(kSchemaVersion, &value)) |
181 holder.SetWithoutPathExpansion(kSchemaVersion, value->DeepCopy()); | 181 holder.SetWithoutPathExpansion(kSchemaVersion, value->CreateDeepCopy()); |
182 if (password_data.GetWithoutPathExpansion(kSalt, &value)) | 182 if (password_data.GetWithoutPathExpansion(kSalt, &value)) |
183 holder.SetWithoutPathExpansion(kSalt, value->DeepCopy()); | 183 holder.SetWithoutPathExpansion(kSalt, value->CreateDeepCopy()); |
184 if (password_data.GetWithoutPathExpansion(kPasswordRevision, &value)) | 184 if (password_data.GetWithoutPathExpansion(kPasswordRevision, &value)) |
185 holder.SetWithoutPathExpansion(kPasswordRevision, value->DeepCopy()); | 185 holder.SetWithoutPathExpansion(kPasswordRevision, value->CreateDeepCopy()); |
186 owner_->SetPasswordInformation(user_id, &holder); | 186 owner_->SetPasswordInformation(user_id, &holder); |
187 } | 187 } |
188 | 188 |
189 SupervisedUserAuthentication::Schema | 189 SupervisedUserAuthentication::Schema |
190 SupervisedUserAuthentication::GetPasswordSchema( | 190 SupervisedUserAuthentication::GetPasswordSchema( |
191 const std::string& user_id) { | 191 const std::string& user_id) { |
192 base::DictionaryValue holder; | 192 base::DictionaryValue holder; |
193 | 193 |
194 owner_->GetPasswordInformation(user_id, &holder); | 194 owner_->GetPasswordInformation(user_id, &holder); |
195 // Default version. | 195 // Default version. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 LOG(FATAL) << "HMAC::Sign failed"; | 319 LOG(FATAL) << "HMAC::Sign failed"; |
320 | 320 |
321 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); | 321 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); |
322 | 322 |
323 std::string result; | 323 std::string result; |
324 base::Base64Encode(raw_result, &result); | 324 base::Base64Encode(raw_result, &result); |
325 return result; | 325 return result; |
326 } | 326 } |
327 | 327 |
328 } // namespace chromeos | 328 } // namespace chromeos |
OLD | NEW |