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

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: Fixed unit tests. Created 4 years, 9 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
« no previous file with comments | « chromeos/dbus/cryptohome_client.cc ('k') | chromeos/dbus/fake_cryptohome_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 GetSystemSalt(const GetSystemSaltCallback& callback) override; 41 void GetSystemSalt(const GetSystemSaltCallback& callback) override;
42 void GetSanitizedUsername(const std::string& username, 42 void GetSanitizedUsername(const cryptohome::Identification& cryptohome_id,
43 const StringDBusMethodCallback& callback) override; 43 const StringDBusMethodCallback& callback) override;
44 std::string BlockingGetSanitizedUsername( 44 std::string BlockingGetSanitizedUsername(
45 const std::string& username) override; 45 const cryptohome::Identification& cryptohome_id) override;
46 void AsyncMount(const std::string& username, 46 void AsyncMount(const cryptohome::Identification& cryptohome_id,
47 const std::string& key, 47 const std::string& key,
48 int flags, 48 int flags,
49 const AsyncMethodCallback& callback) override; 49 const AsyncMethodCallback& callback) override;
50 void AsyncAddKey(const std::string& username, 50 void AsyncAddKey(const cryptohome::Identification& cryptohome_id,
51 const std::string& key, 51 const std::string& key,
52 const std::string& new_key, 52 const std::string& new_key,
53 const AsyncMethodCallback& callback) override; 53 const AsyncMethodCallback& callback) override;
54 void AsyncMountGuest(const AsyncMethodCallback& callback) override; 54 void AsyncMountGuest(const AsyncMethodCallback& callback) override;
55 void AsyncMountPublic(const std::string& public_mount_id, 55 void AsyncMountPublic(const cryptohome::Identification& public_mount_id,
56 int flags, 56 int flags,
57 const AsyncMethodCallback& callback) override; 57 const AsyncMethodCallback& callback) override;
58 void TpmIsReady(const BoolDBusMethodCallback& callback) override; 58 void TpmIsReady(const BoolDBusMethodCallback& callback) override;
59 void TpmIsEnabled(const BoolDBusMethodCallback& callback) override; 59 void TpmIsEnabled(const BoolDBusMethodCallback& callback) override;
60 bool CallTpmIsEnabledAndBlock(bool* enabled) override; 60 bool CallTpmIsEnabledAndBlock(bool* enabled) override;
61 void TpmGetPassword(const StringDBusMethodCallback& callback) override; 61 void TpmGetPassword(const StringDBusMethodCallback& callback) override;
62 void TpmIsOwned(const BoolDBusMethodCallback& callback) override; 62 void TpmIsOwned(const BoolDBusMethodCallback& callback) override;
63 bool CallTpmIsOwnedAndBlock(bool* owned) override; 63 bool CallTpmIsOwnedAndBlock(bool* owned) override;
64 void TpmIsBeingOwned(const BoolDBusMethodCallback& callback) override; 64 void TpmIsBeingOwned(const BoolDBusMethodCallback& callback) override;
65 bool CallTpmIsBeingOwnedAndBlock(bool* owning) override; 65 bool CallTpmIsBeingOwnedAndBlock(bool* owning) override;
66 void TpmCanAttemptOwnership(const VoidDBusMethodCallback& callback) override; 66 void TpmCanAttemptOwnership(const VoidDBusMethodCallback& callback) override;
67 void TpmClearStoredPassword(const VoidDBusMethodCallback& callback) override; 67 void TpmClearStoredPassword(const VoidDBusMethodCallback& callback) override;
68 bool CallTpmClearStoredPasswordAndBlock() override; 68 bool CallTpmClearStoredPasswordAndBlock() override;
69 void Pkcs11IsTpmTokenReady(const BoolDBusMethodCallback& callback) override; 69 void Pkcs11IsTpmTokenReady(const BoolDBusMethodCallback& callback) override;
70 void Pkcs11GetTpmTokenInfo( 70 void Pkcs11GetTpmTokenInfo(
71 const Pkcs11GetTpmTokenInfoCallback& callback) override; 71 const Pkcs11GetTpmTokenInfoCallback& callback) override;
72 void Pkcs11GetTpmTokenInfoForUser( 72 void Pkcs11GetTpmTokenInfoForUser(
73 const std::string& username, 73 const cryptohome::Identification& cryptohome_id,
74 const Pkcs11GetTpmTokenInfoCallback& callback) override; 74 const Pkcs11GetTpmTokenInfoCallback& callback) override;
75 bool InstallAttributesGet(const std::string& name, 75 bool InstallAttributesGet(const std::string& name,
76 std::vector<uint8_t>* value, 76 std::vector<uint8_t>* value,
77 bool* successful) override; 77 bool* successful) override;
78 bool InstallAttributesSet(const std::string& name, 78 bool InstallAttributesSet(const std::string& name,
79 const std::vector<uint8_t>& value, 79 const std::vector<uint8_t>& value,
80 bool* successful) override; 80 bool* successful) override;
81 bool InstallAttributesFinalize(bool* successful) override; 81 bool InstallAttributesFinalize(bool* successful) override;
82 void InstallAttributesIsReady( 82 void InstallAttributesIsReady(
83 const BoolDBusMethodCallback& callback) override; 83 const BoolDBusMethodCallback& callback) override;
84 bool InstallAttributesIsInvalid(bool* is_invalid) override; 84 bool InstallAttributesIsInvalid(bool* is_invalid) override;
85 bool InstallAttributesIsFirstInstall(bool* is_first_install) override; 85 bool InstallAttributesIsFirstInstall(bool* is_first_install) override;
86 void TpmAttestationIsPrepared( 86 void TpmAttestationIsPrepared(
87 const BoolDBusMethodCallback& callback) override; 87 const BoolDBusMethodCallback& callback) override;
88 void TpmAttestationIsEnrolled( 88 void TpmAttestationIsEnrolled(
89 const BoolDBusMethodCallback& callback) override; 89 const BoolDBusMethodCallback& callback) override;
90 void AsyncTpmAttestationCreateEnrollRequest( 90 void AsyncTpmAttestationCreateEnrollRequest(
91 chromeos::attestation::PrivacyCAType pca_type, 91 chromeos::attestation::PrivacyCAType pca_type,
92 const AsyncMethodCallback& callback) override; 92 const AsyncMethodCallback& callback) override;
93 void AsyncTpmAttestationEnroll(chromeos::attestation::PrivacyCAType pca_type, 93 void AsyncTpmAttestationEnroll(chromeos::attestation::PrivacyCAType pca_type,
94 const std::string& pca_response, 94 const std::string& pca_response,
95 const AsyncMethodCallback& callback) override; 95 const AsyncMethodCallback& callback) override;
96 void AsyncTpmAttestationCreateCertRequest( 96 void AsyncTpmAttestationCreateCertRequest(
97 chromeos::attestation::PrivacyCAType pca_type, 97 chromeos::attestation::PrivacyCAType pca_type,
98 attestation::AttestationCertificateProfile certificate_profile, 98 attestation::AttestationCertificateProfile certificate_profile,
99 const std::string& user_id, 99 const cryptohome::Identification& cryptohome_id,
100 const std::string& request_origin, 100 const std::string& request_origin,
101 const AsyncMethodCallback& callback) override; 101 const AsyncMethodCallback& callback) override;
102 void AsyncTpmAttestationFinishCertRequest( 102 void AsyncTpmAttestationFinishCertRequest(
103 const std::string& pca_response, 103 const std::string& pca_response,
104 attestation::AttestationKeyType key_type, 104 attestation::AttestationKeyType key_type,
105 const std::string& user_id, 105 const cryptohome::Identification& cryptohome_id,
106 const std::string& key_name, 106 const std::string& key_name,
107 const AsyncMethodCallback& callback) override; 107 const AsyncMethodCallback& callback) override;
108 void TpmAttestationDoesKeyExist( 108 void TpmAttestationDoesKeyExist(
109 attestation::AttestationKeyType key_type, 109 attestation::AttestationKeyType key_type,
110 const std::string& user_id, 110 const cryptohome::Identification& cryptohome_id,
111 const std::string& key_name, 111 const std::string& key_name,
112 const BoolDBusMethodCallback& callback) override; 112 const BoolDBusMethodCallback& callback) override;
113 void TpmAttestationGetCertificate( 113 void TpmAttestationGetCertificate(
114 attestation::AttestationKeyType key_type, 114 attestation::AttestationKeyType key_type,
115 const std::string& user_id, 115 const cryptohome::Identification& cryptohome_id,
116 const std::string& key_name, 116 const std::string& key_name,
117 const DataMethodCallback& callback) override; 117 const DataMethodCallback& callback) override;
118 void TpmAttestationGetPublicKey(attestation::AttestationKeyType key_type, 118 void TpmAttestationGetPublicKey(
119 const std::string& user_id, 119 attestation::AttestationKeyType key_type,
120 const std::string& key_name, 120 const cryptohome::Identification& cryptohome_id,
121 const DataMethodCallback& callback) override; 121 const std::string& key_name,
122 void TpmAttestationRegisterKey(attestation::AttestationKeyType key_type, 122 const DataMethodCallback& callback) override;
123 const std::string& user_id, 123 void TpmAttestationRegisterKey(
124 const std::string& key_name, 124 attestation::AttestationKeyType key_type,
125 const AsyncMethodCallback& callback) override; 125 const cryptohome::Identification& cryptohome_id,
126 const std::string& key_name,
127 const AsyncMethodCallback& callback) override;
126 void TpmAttestationSignEnterpriseChallenge( 128 void TpmAttestationSignEnterpriseChallenge(
127 attestation::AttestationKeyType key_type, 129 attestation::AttestationKeyType key_type,
128 const std::string& user_id, 130 const cryptohome::Identification& cryptohome_id,
129 const std::string& key_name, 131 const std::string& key_name,
130 const std::string& domain, 132 const std::string& domain,
131 const std::string& device_id, 133 const std::string& device_id,
132 attestation::AttestationChallengeOptions options, 134 attestation::AttestationChallengeOptions options,
133 const std::string& challenge, 135 const std::string& challenge,
134 const AsyncMethodCallback& callback) override; 136 const AsyncMethodCallback& callback) override;
135 void TpmAttestationSignSimpleChallenge( 137 void TpmAttestationSignSimpleChallenge(
136 attestation::AttestationKeyType key_type, 138 attestation::AttestationKeyType key_type,
137 const std::string& user_id, 139 const cryptohome::Identification& cryptohome_id,
138 const std::string& key_name, 140 const std::string& key_name,
139 const std::string& challenge, 141 const std::string& challenge,
140 const AsyncMethodCallback& callback) override; 142 const AsyncMethodCallback& callback) override;
141 void TpmAttestationGetKeyPayload(attestation::AttestationKeyType key_type, 143 void TpmAttestationGetKeyPayload(
142 const std::string& user_id, 144 attestation::AttestationKeyType key_type,
143 const std::string& key_name, 145 const cryptohome::Identification& cryptohome_id,
144 const DataMethodCallback& callback) override; 146 const std::string& key_name,
147 const DataMethodCallback& callback) override;
145 void TpmAttestationSetKeyPayload( 148 void TpmAttestationSetKeyPayload(
146 attestation::AttestationKeyType key_type, 149 attestation::AttestationKeyType key_type,
147 const std::string& user_id, 150 const cryptohome::Identification& cryptohome_id,
148 const std::string& key_name, 151 const std::string& key_name,
149 const std::string& payload, 152 const std::string& payload,
150 const BoolDBusMethodCallback& callback) override; 153 const BoolDBusMethodCallback& callback) override;
151 void TpmAttestationDeleteKeys( 154 void TpmAttestationDeleteKeys(
152 attestation::AttestationKeyType key_type, 155 attestation::AttestationKeyType key_type,
153 const std::string& user_id, 156 const cryptohome::Identification& cryptohome_id,
154 const std::string& key_prefix, 157 const std::string& key_prefix,
155 const BoolDBusMethodCallback& callback) override; 158 const BoolDBusMethodCallback& callback) override;
156 void GetKeyDataEx(const cryptohome::AccountIdentifier& id, 159 void GetKeyDataEx(const cryptohome::Identification& cryptohome_id,
157 const cryptohome::AuthorizationRequest& auth, 160 const cryptohome::AuthorizationRequest& auth,
158 const cryptohome::GetKeyDataRequest& request, 161 const cryptohome::GetKeyDataRequest& request,
159 const ProtobufMethodCallback& callback) override; 162 const ProtobufMethodCallback& callback) override;
160 void CheckKeyEx(const cryptohome::AccountIdentifier& id, 163 void CheckKeyEx(const cryptohome::Identification& cryptohome_id,
161 const cryptohome::AuthorizationRequest& auth, 164 const cryptohome::AuthorizationRequest& auth,
162 const cryptohome::CheckKeyRequest& request, 165 const cryptohome::CheckKeyRequest& request,
163 const ProtobufMethodCallback& callback) override; 166 const ProtobufMethodCallback& callback) override;
164 void MountEx(const cryptohome::AccountIdentifier& id, 167 void MountEx(const cryptohome::Identification& cryptohome_id,
165 const cryptohome::AuthorizationRequest& auth, 168 const cryptohome::AuthorizationRequest& auth,
166 const cryptohome::MountRequest& request, 169 const cryptohome::MountRequest& request,
167 const ProtobufMethodCallback& callback) override; 170 const ProtobufMethodCallback& callback) override;
168 void AddKeyEx(const cryptohome::AccountIdentifier& id, 171 void AddKeyEx(const cryptohome::Identification& cryptohome_id,
169 const cryptohome::AuthorizationRequest& auth, 172 const cryptohome::AuthorizationRequest& auth,
170 const cryptohome::AddKeyRequest& request, 173 const cryptohome::AddKeyRequest& request,
171 const ProtobufMethodCallback& callback) override; 174 const ProtobufMethodCallback& callback) override;
172 void UpdateKeyEx(const cryptohome::AccountIdentifier& id, 175 void UpdateKeyEx(const cryptohome::Identification& cryptohome_id,
173 const cryptohome::AuthorizationRequest& auth, 176 const cryptohome::AuthorizationRequest& auth,
174 const cryptohome::UpdateKeyRequest& request, 177 const cryptohome::UpdateKeyRequest& request,
175 const ProtobufMethodCallback& callback) override; 178 const ProtobufMethodCallback& callback) override;
176 void RemoveKeyEx(const cryptohome::AccountIdentifier& id, 179 void RemoveKeyEx(const cryptohome::Identification& cryptohome_id,
177 const cryptohome::AuthorizationRequest& auth, 180 const cryptohome::AuthorizationRequest& auth,
178 const cryptohome::RemoveKeyRequest& request, 181 const cryptohome::RemoveKeyRequest& request,
179 const ProtobufMethodCallback& callback) override; 182 const ProtobufMethodCallback& callback) override;
180 void GetBootAttribute(const cryptohome::GetBootAttributeRequest& request, 183 void GetBootAttribute(const cryptohome::GetBootAttributeRequest& request,
181 const ProtobufMethodCallback& callback) override; 184 const ProtobufMethodCallback& callback) override;
182 void SetBootAttribute(const cryptohome::SetBootAttributeRequest& request, 185 void SetBootAttribute(const cryptohome::SetBootAttributeRequest& request,
183 const ProtobufMethodCallback& callback) override; 186 const ProtobufMethodCallback& callback) override;
184 void FlushAndSignBootAttributes( 187 void FlushAndSignBootAttributes(
185 const cryptohome::FlushAndSignBootAttributesRequest& request, 188 const cryptohome::FlushAndSignBootAttributesRequest& request,
186 const ProtobufMethodCallback& callback) override; 189 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_; 236 std::map<std::string, std::vector<uint8_t>> install_attrs_;
234 bool locked_; 237 bool locked_;
235 base::WeakPtrFactory<FakeCryptohomeClient> weak_ptr_factory_; 238 base::WeakPtrFactory<FakeCryptohomeClient> weak_ptr_factory_;
236 239
237 DISALLOW_COPY_AND_ASSIGN(FakeCryptohomeClient); 240 DISALLOW_COPY_AND_ASSIGN(FakeCryptohomeClient);
238 }; 241 };
239 242
240 } // namespace chromeos 243 } // namespace chromeos
241 244
242 #endif // CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_ 245 #endif // CHROMEOS_DBUS_FAKE_CRYPTOHOME_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/cryptohome_client.cc ('k') | chromeos/dbus/fake_cryptohome_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698