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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 cryptohome::kCryptohomeInterface, | 698 cryptohome::kCryptohomeInterface, |
699 cryptohome::kCryptohomeTpmAttestationDeleteKeys); | 699 cryptohome::kCryptohomeTpmAttestationDeleteKeys); |
700 dbus::MessageWriter writer(&method_call); | 700 dbus::MessageWriter writer(&method_call); |
701 bool is_user_specific = (key_type == attestation::KEY_USER); | 701 bool is_user_specific = (key_type == attestation::KEY_USER); |
702 writer.AppendBool(is_user_specific); | 702 writer.AppendBool(is_user_specific); |
703 writer.AppendString(user_id); | 703 writer.AppendString(user_id); |
704 writer.AppendString(key_prefix); | 704 writer.AppendString(key_prefix); |
705 CallBoolMethod(&method_call, callback); | 705 CallBoolMethod(&method_call, callback); |
706 } | 706 } |
707 | 707 |
| 708 virtual void GetKeyDataEx( |
| 709 const cryptohome::AccountIdentifier& id, |
| 710 const cryptohome::AuthorizationRequest& auth, |
| 711 const cryptohome::GetKeyDataRequest& request, |
| 712 const ProtobufMethodCallback& callback) { |
| 713 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, |
| 714 cryptohome::kCryptohomeGetKeyDataEx); |
| 715 dbus::MessageWriter writer(&method_call); |
| 716 writer.AppendProtoAsArrayOfBytes(id); |
| 717 writer.AppendProtoAsArrayOfBytes(auth); |
| 718 writer.AppendProtoAsArrayOfBytes(request); |
| 719 |
| 720 proxy_->CallMethod(&method_call, |
| 721 kTpmDBusTimeoutMs, |
| 722 base::Bind(&CryptohomeClientImpl::OnBaseReplyMethod, |
| 723 weak_ptr_factory_.GetWeakPtr(), |
| 724 callback)); |
| 725 } |
| 726 |
708 virtual void CheckKeyEx( | 727 virtual void CheckKeyEx( |
709 const cryptohome::AccountIdentifier& id, | 728 const cryptohome::AccountIdentifier& id, |
710 const cryptohome::AuthorizationRequest& auth, | 729 const cryptohome::AuthorizationRequest& auth, |
711 const cryptohome::CheckKeyRequest& request, | 730 const cryptohome::CheckKeyRequest& request, |
712 const ProtobufMethodCallback& callback) OVERRIDE { | 731 const ProtobufMethodCallback& callback) OVERRIDE { |
713 const char* method_name = cryptohome::kCryptohomeCheckKeyEx; | 732 const char* method_name = cryptohome::kCryptohomeCheckKeyEx; |
714 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, | 733 dbus::MethodCall method_call(cryptohome::kCryptohomeInterface, |
715 method_name); | 734 method_name); |
716 | 735 |
717 dbus::MessageWriter writer(&method_call); | 736 dbus::MessageWriter writer(&method_call); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 return new CryptohomeClientImpl(); | 1146 return new CryptohomeClientImpl(); |
1128 } | 1147 } |
1129 | 1148 |
1130 // static | 1149 // static |
1131 std::string CryptohomeClient::GetStubSanitizedUsername( | 1150 std::string CryptohomeClient::GetStubSanitizedUsername( |
1132 const std::string& username) { | 1151 const std::string& username) { |
1133 return username + kUserIdStubHashSuffix; | 1152 return username + kUserIdStubHashSuffix; |
1134 } | 1153 } |
1135 | 1154 |
1136 } // namespace chromeos | 1155 } // namespace chromeos |
OLD | NEW |