| OLD | NEW |
| 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 "chromeos/dbus/cryptohome_client.h" | 5 #include "chromeos/dbus/cryptohome_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 cryptohome::kCryptohomeAsyncRemove); | 121 cryptohome::kCryptohomeAsyncRemove); |
| 122 dbus::MessageWriter writer(&method_call); | 122 dbus::MessageWriter writer(&method_call); |
| 123 writer.AppendString(cryptohome_id.id()); | 123 writer.AppendString(cryptohome_id.id()); |
| 124 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , | 124 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , |
| 125 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, | 125 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, |
| 126 weak_ptr_factory_.GetWeakPtr(), | 126 weak_ptr_factory_.GetWeakPtr(), |
| 127 callback)); | 127 callback)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 // CryptohomeClient override. | 130 // CryptohomeClient override. |
| 131 void RenameCryptohome(const cryptohome::Identification& cryptohome_id_from, |
| 132 const cryptohome::Identification& cryptohome_id_to, |
| 133 const ProtobufMethodCallback& callback) override { |
| 134 const char* method_name = cryptohome::kCryptohomeRenameCryptohome; |
| 135 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, method_name); |
| 136 |
| 137 cryptohome::AccountIdentifier id_from_proto; |
| 138 cryptohome::AccountIdentifier id_to_proto; |
| 139 FillIdentificationProtobuf(cryptohome_id_from, &id_from_proto); |
| 140 FillIdentificationProtobuf(cryptohome_id_to, &id_to_proto); |
| 141 |
| 142 dbus::MessageWriter writer(&method_call); |
| 143 writer.AppendProtoAsArrayOfBytes(id_from_proto); |
| 144 writer.AppendProtoAsArrayOfBytes(id_to_proto); |
| 145 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs, |
| 146 base::Bind(&CryptohomeClientImpl::OnBaseReplyMethod, |
| 147 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 148 } |
| 149 |
| 150 // CryptohomeClient override. |
| 131 void GetSystemSalt(const GetSystemSaltCallback& callback) override { | 151 void GetSystemSalt(const GetSystemSaltCallback& callback) override { |
| 132 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, | 152 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, |
| 133 cryptohome::kCryptohomeGetSystemSalt); | 153 cryptohome::kCryptohomeGetSystemSalt); |
| 134 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , | 154 proxy_->CallMethod(&method_call, kTpmDBusTimeoutMs , |
| 135 base::Bind(&CryptohomeClientImpl::OnGetSystemSalt, | 155 base::Bind(&CryptohomeClientImpl::OnGetSystemSalt, |
| 136 weak_ptr_factory_.GetWeakPtr(), | 156 weak_ptr_factory_.GetWeakPtr(), |
| 137 callback)); | 157 callback)); |
| 138 } | 158 } |
| 139 | 159 |
| 140 // CryptohomeClient override, | 160 // CryptohomeClient override, |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 return new CryptohomeClientImpl(); | 1183 return new CryptohomeClientImpl(); |
| 1164 } | 1184 } |
| 1165 | 1185 |
| 1166 // static | 1186 // static |
| 1167 std::string CryptohomeClient::GetStubSanitizedUsername( | 1187 std::string CryptohomeClient::GetStubSanitizedUsername( |
| 1168 const cryptohome::Identification& cryptohome_id) { | 1188 const cryptohome::Identification& cryptohome_id) { |
| 1169 return cryptohome_id.id() + kUserIdStubHashSuffix; | 1189 return cryptohome_id.id() + kUserIdStubHashSuffix; |
| 1170 } | 1190 } |
| 1171 | 1191 |
| 1172 } // namespace chromeos | 1192 } // namespace chromeos |
| OLD | NEW |