Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: chromeos/dbus/fake_cryptohome_client.h

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better condition in LOG_ASSERT in AccountId. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_ 6 #define CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 11 matching lines...) Expand all
22 22
23 void Init(dbus::Bus* bus) override; 23 void Init(dbus::Bus* bus) override;
24 void SetAsyncCallStatusHandlers( 24 void SetAsyncCallStatusHandlers(
25 const AsyncCallStatusHandler& handler, 25 const AsyncCallStatusHandler& handler,
26 const AsyncCallStatusWithDataHandler& data_handler) override; 26 const AsyncCallStatusWithDataHandler& data_handler) override;
27 void ResetAsyncCallStatusHandlers() override; 27 void ResetAsyncCallStatusHandlers() override;
28 void WaitForServiceToBeAvailable( 28 void WaitForServiceToBeAvailable(
29 const WaitForServiceToBeAvailableCallback& callback) override; 29 const WaitForServiceToBeAvailableCallback& callback) override;
30 void IsMounted(const BoolDBusMethodCallback& callback) override; 30 void IsMounted(const BoolDBusMethodCallback& callback) override;
31 bool Unmount(bool* success) override; 31 bool Unmount(bool* success) override;
32 void AsyncCheckKey(const std::string& username, 32 void AsyncCheckKey(const cryptohome::Identification& cryptohome_id,
33 const std::string& key, 33 const std::string& key,
34 const AsyncMethodCallback& callback) override; 34 const AsyncMethodCallback& callback) override;
35 void AsyncMigrateKey(const std::string& username, 35 void AsyncMigrateKey(const cryptohome::Identification& cryptohome_id,
36 const std::string& from_key, 36 const std::string& from_key,
37 const std::string& to_key, 37 const std::string& to_key,
38 const AsyncMethodCallback& callback) override; 38 const AsyncMethodCallback& callback) override;
39 void AsyncRemove(const std::string& username, 39 void AsyncRemove(const cryptohome::Identification& cryptohome_id,
40 const AsyncMethodCallback& callback) override; 40 const AsyncMethodCallback& callback) override;
41 void RenameCryptohome(const cryptohome::Identification& cryptohome_id_from,
42 const cryptohome::Identification& cryptohome_id_to,
43 const ProtobufMethodCallback& callback) override;
41 void GetSystemSalt(const GetSystemSaltCallback& callback) override; 44 void GetSystemSalt(const GetSystemSaltCallback& callback) override;
42 void GetSanitizedUsername(const std::string& username, 45 void GetSanitizedUsername(const cryptohome::Identification& cryptohome_id,
43 const StringDBusMethodCallback& callback) override; 46 const StringDBusMethodCallback& callback) override;
44 std::string BlockingGetSanitizedUsername( 47 std::string BlockingGetSanitizedUsername(
45 const std::string& username) override; 48 const cryptohome::Identification& cryptohome_id) override;
46 void AsyncMount(const std::string& username, 49 void AsyncMount(const cryptohome::Identification& cryptohome_id,
47 const std::string& key, 50 const std::string& key,
48 int flags, 51 int flags,
49 const AsyncMethodCallback& callback) override; 52 const AsyncMethodCallback& callback) override;
50 void AsyncAddKey(const std::string& username, 53 void AsyncAddKey(const cryptohome::Identification& cryptohome_id,
51 const std::string& key, 54 const std::string& key,
52 const std::string& new_key, 55 const std::string& new_key,
53 const AsyncMethodCallback& callback) override; 56 const AsyncMethodCallback& callback) override;
54 void AsyncMountGuest(const AsyncMethodCallback& callback) override; 57 void AsyncMountGuest(const AsyncMethodCallback& callback) override;
55 void AsyncMountPublic(const std::string& public_mount_id, 58 void AsyncMountPublic(const cryptohome::Identification& public_mount_id,
56 int flags, 59 int flags,
57 const AsyncMethodCallback& callback) override; 60 const AsyncMethodCallback& callback) override;
58 void TpmIsReady(const BoolDBusMethodCallback& callback) override; 61 void TpmIsReady(const BoolDBusMethodCallback& callback) override;
59 void TpmIsEnabled(const BoolDBusMethodCallback& callback) override; 62 void TpmIsEnabled(const BoolDBusMethodCallback& callback) override;
60 bool CallTpmIsEnabledAndBlock(bool* enabled) override; 63 bool CallTpmIsEnabledAndBlock(bool* enabled) override;
61 void TpmGetPassword(const StringDBusMethodCallback& callback) override; 64 void TpmGetPassword(const StringDBusMethodCallback& callback) override;
62 void TpmIsOwned(const BoolDBusMethodCallback& callback) override; 65 void TpmIsOwned(const BoolDBusMethodCallback& callback) override;
63 bool CallTpmIsOwnedAndBlock(bool* owned) override; 66 bool CallTpmIsOwnedAndBlock(bool* owned) override;
64 void TpmIsBeingOwned(const BoolDBusMethodCallback& callback) override; 67 void TpmIsBeingOwned(const BoolDBusMethodCallback& callback) override;
65 bool CallTpmIsBeingOwnedAndBlock(bool* owning) override; 68 bool CallTpmIsBeingOwnedAndBlock(bool* owning) override;
66 void TpmCanAttemptOwnership(const VoidDBusMethodCallback& callback) override; 69 void TpmCanAttemptOwnership(const VoidDBusMethodCallback& callback) override;
67 void TpmClearStoredPassword(const VoidDBusMethodCallback& callback) override; 70 void TpmClearStoredPassword(const VoidDBusMethodCallback& callback) override;
68 bool CallTpmClearStoredPasswordAndBlock() override; 71 bool CallTpmClearStoredPasswordAndBlock() override;
69 void Pkcs11IsTpmTokenReady(const BoolDBusMethodCallback& callback) override; 72 void Pkcs11IsTpmTokenReady(const BoolDBusMethodCallback& callback) override;
70 void Pkcs11GetTpmTokenInfo( 73 void Pkcs11GetTpmTokenInfo(
71 const Pkcs11GetTpmTokenInfoCallback& callback) override; 74 const Pkcs11GetTpmTokenInfoCallback& callback) override;
72 void Pkcs11GetTpmTokenInfoForUser( 75 void Pkcs11GetTpmTokenInfoForUser(
73 const std::string& username, 76 const cryptohome::Identification& cryptohome_id,
74 const Pkcs11GetTpmTokenInfoCallback& callback) override; 77 const Pkcs11GetTpmTokenInfoCallback& callback) override;
75 bool InstallAttributesGet(const std::string& name, 78 bool InstallAttributesGet(const std::string& name,
76 std::vector<uint8_t>* value, 79 std::vector<uint8_t>* value,
77 bool* successful) override; 80 bool* successful) override;
78 bool InstallAttributesSet(const std::string& name, 81 bool InstallAttributesSet(const std::string& name,
79 const std::vector<uint8_t>& value, 82 const std::vector<uint8_t>& value,
80 bool* successful) override; 83 bool* successful) override;
81 bool InstallAttributesFinalize(bool* successful) override; 84 bool InstallAttributesFinalize(bool* successful) override;
82 void InstallAttributesIsReady( 85 void InstallAttributesIsReady(
83 const BoolDBusMethodCallback& callback) override; 86 const BoolDBusMethodCallback& callback) override;
84 bool InstallAttributesIsInvalid(bool* is_invalid) override; 87 bool InstallAttributesIsInvalid(bool* is_invalid) override;
85 bool InstallAttributesIsFirstInstall(bool* is_first_install) override; 88 bool InstallAttributesIsFirstInstall(bool* is_first_install) override;
86 void TpmAttestationIsPrepared( 89 void TpmAttestationIsPrepared(
87 const BoolDBusMethodCallback& callback) override; 90 const BoolDBusMethodCallback& callback) override;
88 void TpmAttestationIsEnrolled( 91 void TpmAttestationIsEnrolled(
89 const BoolDBusMethodCallback& callback) override; 92 const BoolDBusMethodCallback& callback) override;
90 void AsyncTpmAttestationCreateEnrollRequest( 93 void AsyncTpmAttestationCreateEnrollRequest(
91 chromeos::attestation::PrivacyCAType pca_type, 94 chromeos::attestation::PrivacyCAType pca_type,
92 const AsyncMethodCallback& callback) override; 95 const AsyncMethodCallback& callback) override;
93 void AsyncTpmAttestationEnroll(chromeos::attestation::PrivacyCAType pca_type, 96 void AsyncTpmAttestationEnroll(chromeos::attestation::PrivacyCAType pca_type,
94 const std::string& pca_response, 97 const std::string& pca_response,
95 const AsyncMethodCallback& callback) override; 98 const AsyncMethodCallback& callback) override;
96 void AsyncTpmAttestationCreateCertRequest( 99 void AsyncTpmAttestationCreateCertRequest(
97 chromeos::attestation::PrivacyCAType pca_type, 100 chromeos::attestation::PrivacyCAType pca_type,
98 attestation::AttestationCertificateProfile certificate_profile, 101 attestation::AttestationCertificateProfile certificate_profile,
99 const std::string& user_id, 102 const cryptohome::Identification& cryptohome_id,
100 const std::string& request_origin, 103 const std::string& request_origin,
101 const AsyncMethodCallback& callback) override; 104 const AsyncMethodCallback& callback) override;
102 void AsyncTpmAttestationFinishCertRequest( 105 void AsyncTpmAttestationFinishCertRequest(
103 const std::string& pca_response, 106 const std::string& pca_response,
104 attestation::AttestationKeyType key_type, 107 attestation::AttestationKeyType key_type,
105 const std::string& user_id, 108 const cryptohome::Identification& cryptohome_id,
106 const std::string& key_name, 109 const std::string& key_name,
107 const AsyncMethodCallback& callback) override; 110 const AsyncMethodCallback& callback) override;
108 void TpmAttestationDoesKeyExist( 111 void TpmAttestationDoesKeyExist(
109 attestation::AttestationKeyType key_type, 112 attestation::AttestationKeyType key_type,
110 const std::string& user_id, 113 const cryptohome::Identification& cryptohome_id,
111 const std::string& key_name, 114 const std::string& key_name,
112 const BoolDBusMethodCallback& callback) override; 115 const BoolDBusMethodCallback& callback) override;
113 void TpmAttestationGetCertificate( 116 void TpmAttestationGetCertificate(
114 attestation::AttestationKeyType key_type, 117 attestation::AttestationKeyType key_type,
115 const std::string& user_id, 118 const cryptohome::Identification& cryptohome_id,
116 const std::string& key_name, 119 const std::string& key_name,
117 const DataMethodCallback& callback) override; 120 const DataMethodCallback& callback) override;
118 void TpmAttestationGetPublicKey(attestation::AttestationKeyType key_type, 121 void TpmAttestationGetPublicKey(
119 const std::string& user_id, 122 attestation::AttestationKeyType key_type,
120 const std::string& key_name, 123 const cryptohome::Identification& cryptohome_id,
121 const DataMethodCallback& callback) override; 124 const std::string& key_name,
122 void TpmAttestationRegisterKey(attestation::AttestationKeyType key_type, 125 const DataMethodCallback& callback) override;
123 const std::string& user_id, 126 void TpmAttestationRegisterKey(
124 const std::string& key_name, 127 attestation::AttestationKeyType key_type,
125 const AsyncMethodCallback& callback) override; 128 const cryptohome::Identification& cryptohome_id,
129 const std::string& key_name,
130 const AsyncMethodCallback& callback) override;
126 void TpmAttestationSignEnterpriseChallenge( 131 void TpmAttestationSignEnterpriseChallenge(
127 attestation::AttestationKeyType key_type, 132 attestation::AttestationKeyType key_type,
128 const std::string& user_id, 133 const cryptohome::Identification& cryptohome_id,
129 const std::string& key_name, 134 const std::string& key_name,
130 const std::string& domain, 135 const std::string& domain,
131 const std::string& device_id, 136 const std::string& device_id,
132 attestation::AttestationChallengeOptions options, 137 attestation::AttestationChallengeOptions options,
133 const std::string& challenge, 138 const std::string& challenge,
134 const AsyncMethodCallback& callback) override; 139 const AsyncMethodCallback& callback) override;
135 void TpmAttestationSignSimpleChallenge( 140 void TpmAttestationSignSimpleChallenge(
136 attestation::AttestationKeyType key_type, 141 attestation::AttestationKeyType key_type,
137 const std::string& user_id, 142 const cryptohome::Identification& cryptohome_id,
138 const std::string& key_name, 143 const std::string& key_name,
139 const std::string& challenge, 144 const std::string& challenge,
140 const AsyncMethodCallback& callback) override; 145 const AsyncMethodCallback& callback) override;
141 void TpmAttestationGetKeyPayload(attestation::AttestationKeyType key_type, 146 void TpmAttestationGetKeyPayload(
142 const std::string& user_id, 147 attestation::AttestationKeyType key_type,
143 const std::string& key_name, 148 const cryptohome::Identification& cryptohome_id,
144 const DataMethodCallback& callback) override; 149 const std::string& key_name,
150 const DataMethodCallback& callback) override;
145 void TpmAttestationSetKeyPayload( 151 void TpmAttestationSetKeyPayload(
146 attestation::AttestationKeyType key_type, 152 attestation::AttestationKeyType key_type,
147 const std::string& user_id, 153 const cryptohome::Identification& cryptohome_id,
148 const std::string& key_name, 154 const std::string& key_name,
149 const std::string& payload, 155 const std::string& payload,
150 const BoolDBusMethodCallback& callback) override; 156 const BoolDBusMethodCallback& callback) override;
151 void TpmAttestationDeleteKeys( 157 void TpmAttestationDeleteKeys(
152 attestation::AttestationKeyType key_type, 158 attestation::AttestationKeyType key_type,
153 const std::string& user_id, 159 const cryptohome::Identification& cryptohome_id,
154 const std::string& key_prefix, 160 const std::string& key_prefix,
155 const BoolDBusMethodCallback& callback) override; 161 const BoolDBusMethodCallback& callback) override;
156 void GetKeyDataEx(const cryptohome::AccountIdentifier& id, 162 void GetKeyDataEx(const cryptohome::Identification& cryptohome_id,
157 const cryptohome::AuthorizationRequest& auth, 163 const cryptohome::AuthorizationRequest& auth,
158 const cryptohome::GetKeyDataRequest& request, 164 const cryptohome::GetKeyDataRequest& request,
159 const ProtobufMethodCallback& callback) override; 165 const ProtobufMethodCallback& callback) override;
160 void CheckKeyEx(const cryptohome::AccountIdentifier& id, 166 void CheckKeyEx(const cryptohome::Identification& cryptohome_id,
161 const cryptohome::AuthorizationRequest& auth, 167 const cryptohome::AuthorizationRequest& auth,
162 const cryptohome::CheckKeyRequest& request, 168 const cryptohome::CheckKeyRequest& request,
163 const ProtobufMethodCallback& callback) override; 169 const ProtobufMethodCallback& callback) override;
164 void MountEx(const cryptohome::AccountIdentifier& id, 170 void MountEx(const cryptohome::Identification& cryptohome_id,
165 const cryptohome::AuthorizationRequest& auth, 171 const cryptohome::AuthorizationRequest& auth,
166 const cryptohome::MountRequest& request, 172 const cryptohome::MountRequest& request,
167 const ProtobufMethodCallback& callback) override; 173 const ProtobufMethodCallback& callback) override;
168 void AddKeyEx(const cryptohome::AccountIdentifier& id, 174 void AddKeyEx(const cryptohome::Identification& cryptohome_id,
169 const cryptohome::AuthorizationRequest& auth, 175 const cryptohome::AuthorizationRequest& auth,
170 const cryptohome::AddKeyRequest& request, 176 const cryptohome::AddKeyRequest& request,
171 const ProtobufMethodCallback& callback) override; 177 const ProtobufMethodCallback& callback) override;
172 void UpdateKeyEx(const cryptohome::AccountIdentifier& id, 178 void UpdateKeyEx(const cryptohome::Identification& cryptohome_id,
173 const cryptohome::AuthorizationRequest& auth, 179 const cryptohome::AuthorizationRequest& auth,
174 const cryptohome::UpdateKeyRequest& request, 180 const cryptohome::UpdateKeyRequest& request,
175 const ProtobufMethodCallback& callback) override; 181 const ProtobufMethodCallback& callback) override;
176 void RemoveKeyEx(const cryptohome::AccountIdentifier& id, 182 void RemoveKeyEx(const cryptohome::Identification& cryptohome_id,
177 const cryptohome::AuthorizationRequest& auth, 183 const cryptohome::AuthorizationRequest& auth,
178 const cryptohome::RemoveKeyRequest& request, 184 const cryptohome::RemoveKeyRequest& request,
179 const ProtobufMethodCallback& callback) override; 185 const ProtobufMethodCallback& callback) override;
180 void GetBootAttribute(const cryptohome::GetBootAttributeRequest& request, 186 void GetBootAttribute(const cryptohome::GetBootAttributeRequest& request,
181 const ProtobufMethodCallback& callback) override; 187 const ProtobufMethodCallback& callback) override;
182 void SetBootAttribute(const cryptohome::SetBootAttributeRequest& request, 188 void SetBootAttribute(const cryptohome::SetBootAttributeRequest& request,
183 const ProtobufMethodCallback& callback) override; 189 const ProtobufMethodCallback& callback) override;
184 void FlushAndSignBootAttributes( 190 void FlushAndSignBootAttributes(
185 const cryptohome::FlushAndSignBootAttributesRequest& request, 191 const cryptohome::FlushAndSignBootAttributesRequest& request,
186 const ProtobufMethodCallback& callback) override; 192 const ProtobufMethodCallback& callback) override;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 std::map<std::string, std::vector<uint8_t>> install_attrs_; 239 std::map<std::string, std::vector<uint8_t>> install_attrs_;
234 bool locked_; 240 bool locked_;
235 base::WeakPtrFactory<FakeCryptohomeClient> weak_ptr_factory_; 241 base::WeakPtrFactory<FakeCryptohomeClient> weak_ptr_factory_;
236 242
237 DISALLOW_COPY_AND_ASSIGN(FakeCryptohomeClient); 243 DISALLOW_COPY_AND_ASSIGN(FakeCryptohomeClient);
238 }; 244 };
239 245
240 } // namespace chromeos 246 } // namespace chromeos
241 247
242 #endif // CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_ 248 #endif // CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698