| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 void FakeCryptohomeClient::AsyncTpmAttestationEnroll( | 270 void FakeCryptohomeClient::AsyncTpmAttestationEnroll( |
| 271 const std::string& pca_response, | 271 const std::string& pca_response, |
| 272 const AsyncMethodCallback& callback) { | 272 const AsyncMethodCallback& callback) { |
| 273 ReturnAsyncMethodResult(callback, false); | 273 ReturnAsyncMethodResult(callback, false); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void FakeCryptohomeClient::AsyncTpmAttestationCreateCertRequest( | 276 void FakeCryptohomeClient::AsyncTpmAttestationCreateCertRequest( |
| 277 attestation::AttestationCertificateProfile certificate_profile, | 277 attestation::AttestationCertificateProfile certificate_profile, |
| 278 const std::string& user_email, | 278 const std::string& user_id, |
| 279 const std::string& request_origin, | 279 const std::string& request_origin, |
| 280 const AsyncMethodCallback& callback) { | 280 const AsyncMethodCallback& callback) { |
| 281 ReturnAsyncMethodResult(callback, true); | 281 ReturnAsyncMethodResult(callback, true); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void FakeCryptohomeClient::AsyncTpmAttestationFinishCertRequest( | 284 void FakeCryptohomeClient::AsyncTpmAttestationFinishCertRequest( |
| 285 const std::string& pca_response, | 285 const std::string& pca_response, |
| 286 attestation::AttestationKeyType key_type, | 286 attestation::AttestationKeyType key_type, |
| 287 const std::string& user_id, |
| 287 const std::string& key_name, | 288 const std::string& key_name, |
| 288 const AsyncMethodCallback& callback) { | 289 const AsyncMethodCallback& callback) { |
| 289 ReturnAsyncMethodResult(callback, true); | 290 ReturnAsyncMethodResult(callback, true); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void FakeCryptohomeClient::TpmAttestationDoesKeyExist( | 293 void FakeCryptohomeClient::TpmAttestationDoesKeyExist( |
| 293 attestation::AttestationKeyType key_type, | 294 attestation::AttestationKeyType key_type, |
| 295 const std::string& user_id, |
| 294 const std::string& key_name, | 296 const std::string& key_name, |
| 295 const BoolDBusMethodCallback& callback) { | 297 const BoolDBusMethodCallback& callback) { |
| 296 base::MessageLoop::current()->PostTask( | 298 base::MessageLoop::current()->PostTask( |
| 297 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); | 299 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); |
| 298 } | 300 } |
| 299 | 301 |
| 300 void FakeCryptohomeClient::TpmAttestationGetCertificate( | 302 void FakeCryptohomeClient::TpmAttestationGetCertificate( |
| 301 attestation::AttestationKeyType key_type, | 303 attestation::AttestationKeyType key_type, |
| 304 const std::string& user_id, |
| 302 const std::string& key_name, | 305 const std::string& key_name, |
| 303 const DataMethodCallback& callback) { | 306 const DataMethodCallback& callback) { |
| 304 base::MessageLoop::current()->PostTask( | 307 base::MessageLoop::current()->PostTask( |
| 305 FROM_HERE, | 308 FROM_HERE, |
| 306 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 309 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
| 307 } | 310 } |
| 308 | 311 |
| 309 void FakeCryptohomeClient::TpmAttestationGetPublicKey( | 312 void FakeCryptohomeClient::TpmAttestationGetPublicKey( |
| 310 attestation::AttestationKeyType key_type, | 313 attestation::AttestationKeyType key_type, |
| 314 const std::string& user_id, |
| 311 const std::string& key_name, | 315 const std::string& key_name, |
| 312 const DataMethodCallback& callback) { | 316 const DataMethodCallback& callback) { |
| 313 base::MessageLoop::current()->PostTask( | 317 base::MessageLoop::current()->PostTask( |
| 314 FROM_HERE, | 318 FROM_HERE, |
| 315 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 319 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
| 316 } | 320 } |
| 317 | 321 |
| 318 void FakeCryptohomeClient::TpmAttestationRegisterKey( | 322 void FakeCryptohomeClient::TpmAttestationRegisterKey( |
| 319 attestation::AttestationKeyType key_type, | 323 attestation::AttestationKeyType key_type, |
| 324 const std::string& user_id, |
| 320 const std::string& key_name, | 325 const std::string& key_name, |
| 321 const AsyncMethodCallback& callback) { | 326 const AsyncMethodCallback& callback) { |
| 322 ReturnAsyncMethodResult(callback, true); | 327 ReturnAsyncMethodResult(callback, true); |
| 323 } | 328 } |
| 324 | 329 |
| 325 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( | 330 void FakeCryptohomeClient::TpmAttestationSignEnterpriseChallenge( |
| 326 attestation::AttestationKeyType key_type, | 331 attestation::AttestationKeyType key_type, |
| 332 const std::string& user_id, |
| 327 const std::string& key_name, | 333 const std::string& key_name, |
| 328 const std::string& domain, | 334 const std::string& domain, |
| 329 const std::string& device_id, | 335 const std::string& device_id, |
| 330 attestation::AttestationChallengeOptions options, | 336 attestation::AttestationChallengeOptions options, |
| 331 const std::string& challenge, | 337 const std::string& challenge, |
| 332 const AsyncMethodCallback& callback) { | 338 const AsyncMethodCallback& callback) { |
| 333 ReturnAsyncMethodResult(callback, true); | 339 ReturnAsyncMethodResult(callback, true); |
| 334 } | 340 } |
| 335 | 341 |
| 336 void FakeCryptohomeClient::TpmAttestationSignSimpleChallenge( | 342 void FakeCryptohomeClient::TpmAttestationSignSimpleChallenge( |
| 337 attestation::AttestationKeyType key_type, | 343 attestation::AttestationKeyType key_type, |
| 344 const std::string& user_id, |
| 338 const std::string& key_name, | 345 const std::string& key_name, |
| 339 const std::string& challenge, | 346 const std::string& challenge, |
| 340 const AsyncMethodCallback& callback) { | 347 const AsyncMethodCallback& callback) { |
| 341 ReturnAsyncMethodResult(callback, true); | 348 ReturnAsyncMethodResult(callback, true); |
| 342 } | 349 } |
| 343 | 350 |
| 344 void FakeCryptohomeClient::TpmAttestationGetKeyPayload( | 351 void FakeCryptohomeClient::TpmAttestationGetKeyPayload( |
| 345 attestation::AttestationKeyType key_type, | 352 attestation::AttestationKeyType key_type, |
| 353 const std::string& user_id, |
| 346 const std::string& key_name, | 354 const std::string& key_name, |
| 347 const DataMethodCallback& callback) { | 355 const DataMethodCallback& callback) { |
| 348 base::MessageLoop::current()->PostTask( | 356 base::MessageLoop::current()->PostTask( |
| 349 FROM_HERE, | 357 FROM_HERE, |
| 350 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); | 358 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false, std::string())); |
| 351 } | 359 } |
| 352 | 360 |
| 353 void FakeCryptohomeClient::TpmAttestationSetKeyPayload( | 361 void FakeCryptohomeClient::TpmAttestationSetKeyPayload( |
| 354 attestation::AttestationKeyType key_type, | 362 attestation::AttestationKeyType key_type, |
| 363 const std::string& user_id, |
| 355 const std::string& key_name, | 364 const std::string& key_name, |
| 356 const std::string& payload, | 365 const std::string& payload, |
| 357 const BoolDBusMethodCallback& callback) { | 366 const BoolDBusMethodCallback& callback) { |
| 358 base::MessageLoop::current()->PostTask( | 367 base::MessageLoop::current()->PostTask( |
| 359 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); | 368 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); |
| 360 } | 369 } |
| 361 | 370 |
| 362 // static | 371 // static |
| 363 std::vector<uint8> FakeCryptohomeClient::GetStubSystemSalt() { | 372 std::vector<uint8> FakeCryptohomeClient::GetStubSystemSalt() { |
| 364 const char kStubSystemSalt[] = "stub_system_salt"; | 373 const char kStubSystemSalt[] = "stub_system_salt"; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 393 FROM_HERE, | 402 FROM_HERE, |
| 394 base::Bind(async_call_status_data_handler_, | 403 base::Bind(async_call_status_data_handler_, |
| 395 async_call_id_, | 404 async_call_id_, |
| 396 true, | 405 true, |
| 397 std::string())); | 406 std::string())); |
| 398 } | 407 } |
| 399 ++async_call_id_; | 408 ++async_call_id_; |
| 400 } | 409 } |
| 401 | 410 |
| 402 } // namespace chromeos | 411 } // namespace chromeos |
| OLD | NEW |