OLD | NEW |
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 #include "chromeos/dbus/fake_cryptohome_client.h" | 5 #include "chromeos/dbus/fake_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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "crypto/nss_util.h" | 10 #include "crypto/nss_util.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 attestation::AttestationCertificateProfile certificate_profile, | 279 attestation::AttestationCertificateProfile certificate_profile, |
280 const std::string& user_email, | 280 const std::string& user_email, |
281 const std::string& request_origin, | 281 const std::string& request_origin, |
282 const AsyncMethodCallback& callback) { | 282 const AsyncMethodCallback& callback) { |
283 ReturnAsyncMethodResult(callback, true); | 283 ReturnAsyncMethodResult(callback, true); |
284 } | 284 } |
285 | 285 |
286 void FakeCryptohomeClient::AsyncTpmAttestationFinishCertRequest( | 286 void FakeCryptohomeClient::AsyncTpmAttestationFinishCertRequest( |
287 const std::string& pca_response, | 287 const std::string& pca_response, |
288 attestation::AttestationKeyType key_type, | 288 attestation::AttestationKeyType key_type, |
| 289 const std::string& user_email, |
289 const std::string& key_name, | 290 const std::string& key_name, |
290 const AsyncMethodCallback& callback) { | 291 const AsyncMethodCallback& callback) { |
291 ReturnAsyncMethodResult(callback, true); | 292 ReturnAsyncMethodResult(callback, true); |
292 } | 293 } |
293 | 294 |
294 void FakeCryptohomeClient::TpmAttestationDoesKeyExist( | 295 void FakeCryptohomeClient::TpmAttestationDoesKeyExist( |
295 attestation::AttestationKeyType key_type, | 296 attestation::AttestationKeyType key_type, |
| 297 const std::string& user_email, |
296 const std::string& key_name, | 298 const std::string& key_name, |
297 const BoolDBusMethodCallback& callback) { | 299 const BoolDBusMethodCallback& callback) { |
298 base::MessageLoop::current()->PostTask( | 300 base::MessageLoop::current()->PostTask( |
299 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); | 301 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); |
300 } | 302 } |
301 | 303 |
302 void FakeCryptohomeClient::TpmAttestationGetCertificate( | 304 void FakeCryptohomeClient::TpmAttestationGetCertificate( |
303 attestation::AttestationKeyType key_type, | 305 attestation::AttestationKeyType key_type, |
| 306 const std::string& user_email, |
304 const std::string& key_name, | 307 const std::string& key_name, |
305 const DataMethodCallback& callback) { | 308 const DataMethodCallback& callback) { |
306 base::MessageLoop::current()->PostTask( | 309 base::MessageLoop::current()->PostTask( |
307 FROM_HERE, | 310 FROM_HERE, |
308 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 311 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
309 } | 312 } |
310 | 313 |
311 void FakeCryptohomeClient::TpmAttestationGetPublicKey( | 314 void FakeCryptohomeClient::TpmAttestationGetPublicKey( |
312 attestation::AttestationKeyType key_type, | 315 attestation::AttestationKeyType key_type, |
| 316 const std::string& user_email, |
313 const std::string& key_name, | 317 const std::string& key_name, |
314 const DataMethodCallback& callback) { | 318 const DataMethodCallback& callback) { |
315 base::MessageLoop::current()->PostTask( | 319 base::MessageLoop::current()->PostTask( |
316 FROM_HERE, | 320 FROM_HERE, |
317 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 321 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
318 } | 322 } |
319 | 323 |
320 void FakeCryptohomeClient::TpmAttestationRegisterKey( | 324 void FakeCryptohomeClient::TpmAttestationRegisterKey( |
321 attestation::AttestationKeyType key_type, | 325 attestation::AttestationKeyType key_type, |
| 326 const std::string& user_email, |
322 const std::string& key_name, | 327 const std::string& key_name, |
323 const AsyncMethodCallback& callback) { | 328 const AsyncMethodCallback& callback) { |
324 ReturnAsyncMethodResult(callback, true); | 329 ReturnAsyncMethodResult(callback, true); |
325 } | 330 } |
326 | 331 |
327 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( | 332 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( |
328 attestation::AttestationKeyType key_type, | 333 attestation::AttestationKeyType key_type, |
| 334 const std::string& user_email, |
329 const std::string& key_name, | 335 const std::string& key_name, |
330 const std::string& domain, | 336 const std::string& domain, |
331 const std::string& device_id, | 337 const std::string& device_id, |
332 attestation::AttestationChallengeOptions options, | 338 attestation::AttestationChallengeOptions options, |
333 const std::string& challenge, | 339 const std::string& challenge, |
334 const AsyncMethodCallback& callback) { | 340 const AsyncMethodCallback& callback) { |
335 ReturnAsyncMethodResult(callback, true); | 341 ReturnAsyncMethodResult(callback, true); |
336 } | 342 } |
337 | 343 |
338 void FakeCryptohomeClient::TpmAttestationSignSimpleChallenge( | 344 void FakeCryptohomeClient::TpmAttestationSignSimpleChallenge( |
339 attestation::AttestationKeyType key_type, | 345 attestation::AttestationKeyType key_type, |
| 346 const std::string& user_email, |
340 const std::string& key_name, | 347 const std::string& key_name, |
341 const std::string& challenge, | 348 const std::string& challenge, |
342 const AsyncMethodCallback& callback) { | 349 const AsyncMethodCallback& callback) { |
343 ReturnAsyncMethodResult(callback, true); | 350 ReturnAsyncMethodResult(callback, true); |
344 } | 351 } |
345 | 352 |
346 void FakeCryptohomeClient::TpmAttestationGetKeyPayload( | 353 void FakeCryptohomeClient::TpmAttestationGetKeyPayload( |
347 attestation::AttestationKeyType key_type, | 354 attestation::AttestationKeyType key_type, |
| 355 const std::string& user_email, |
348 const std::string& key_name, | 356 const std::string& key_name, |
349 const DataMethodCallback& callback) { | 357 const DataMethodCallback& callback) { |
350 base::MessageLoop::current()->PostTask( | 358 base::MessageLoop::current()->PostTask( |
351 FROM_HERE, | 359 FROM_HERE, |
352 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 360 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
353 } | 361 } |
354 | 362 |
355 void FakeCryptohomeClient::TpmAttestationSetKeyPayload( | 363 void FakeCryptohomeClient::TpmAttestationSetKeyPayload( |
356 attestation::AttestationKeyType key_type, | 364 attestation::AttestationKeyType key_type, |
| 365 const std::string& user_email, |
357 const std::string& key_name, | 366 const std::string& key_name, |
358 const std::string& payload, | 367 const std::string& payload, |
359 const BoolDBusMethodCallback& callback) { | 368 const BoolDBusMethodCallback& callback) { |
360 base::MessageLoop::current()->PostTask( | 369 base::MessageLoop::current()->PostTask( |
361 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); | 370 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); |
362 } | 371 } |
363 | 372 |
364 void FakeCryptohomeClient::ReturnAsyncMethodResult( | 373 void FakeCryptohomeClient::ReturnAsyncMethodResult( |
365 const AsyncMethodCallback& callback, | 374 const AsyncMethodCallback& callback, |
366 bool returns_data) { | 375 bool returns_data) { |
(...skipping 21 matching lines...) Expand all Loading... |
388 FROM_HERE, | 397 FROM_HERE, |
389 base::Bind(async_call_status_data_handler_, | 398 base::Bind(async_call_status_data_handler_, |
390 async_call_id_, | 399 async_call_id_, |
391 true, | 400 true, |
392 std::string())); | 401 std::string())); |
393 } | 402 } |
394 ++async_call_id_; | 403 ++async_call_id_; |
395 } | 404 } |
396 | 405 |
397 } // namespace chromeos | 406 } // namespace chromeos |
OLD | NEW |