| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 reinterpret_cast<const uint8*>(pca_response.data()), | 459 reinterpret_cast<const uint8*>(pca_response.data()), |
| 460 pca_response.size()); | 460 pca_response.size()); |
| 461 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 461 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 462 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, | 462 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, |
| 463 weak_ptr_factory_.GetWeakPtr(), | 463 weak_ptr_factory_.GetWeakPtr(), |
| 464 callback)); | 464 callback)); |
| 465 } | 465 } |
| 466 | 466 |
| 467 // CryptohomeClient override. | 467 // CryptohomeClient override. |
| 468 virtual void AsyncTpmAttestationCreateCertRequest( | 468 virtual void AsyncTpmAttestationCreateCertRequest( |
| 469 int options, | 469 attestation::AttestationCertificateProfile certificate_profile, |
| 470 const std::string& user_email, |
| 471 const std::string& request_origin, |
| 470 const AsyncMethodCallback& callback) OVERRIDE { | 472 const AsyncMethodCallback& callback) OVERRIDE { |
| 471 dbus::MethodCall method_call( | 473 dbus::MethodCall method_call( |
| 472 cryptohome::kCryptohomeInterface, | 474 cryptohome::kCryptohomeInterface, |
| 473 cryptohome::kCryptohomeAsyncTpmAttestationCreateCertRequest); | 475 cryptohome::kCryptohomeAsyncTpmAttestationCreateCertRequestByProfile); |
| 474 dbus::MessageWriter writer(&method_call); | 476 dbus::MessageWriter writer(&method_call); |
| 475 bool include_stable_id = | 477 writer.AppendInt32(certificate_profile); |
| 476 (options & attestation::CERTIFICATE_INCLUDE_STABLE_ID); | 478 writer.AppendString(user_email); |
| 477 writer.AppendBool(include_stable_id); | 479 writer.AppendString(request_origin); |
| 478 bool include_device_state = | |
| 479 (options & attestation::CERTIFICATE_INCLUDE_DEVICE_STATE); | |
| 480 writer.AppendBool(include_device_state); | |
| 481 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 480 proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 482 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, | 481 base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall, |
| 483 weak_ptr_factory_.GetWeakPtr(), | 482 weak_ptr_factory_.GetWeakPtr(), |
| 484 callback)); | 483 callback)); |
| 485 } | 484 } |
| 486 | 485 |
| 487 // CryptohomeClient override. | 486 // CryptohomeClient override. |
| 488 virtual void AsyncTpmAttestationFinishCertRequest( | 487 virtual void AsyncTpmAttestationFinishCertRequest( |
| 489 const std::string& pca_response, | 488 const std::string& pca_response, |
| 490 attestation::AttestationKeyType key_type, | 489 attestation::AttestationKeyType key_type, |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 return new CryptohomeClientStubImpl(); | 858 return new CryptohomeClientStubImpl(); |
| 860 } | 859 } |
| 861 | 860 |
| 862 // static | 861 // static |
| 863 std::string CryptohomeClient::GetStubSanitizedUsername( | 862 std::string CryptohomeClient::GetStubSanitizedUsername( |
| 864 const std::string& username) { | 863 const std::string& username) { |
| 865 return username + kUserIdStubHashSuffix; | 864 return username + kUserIdStubHashSuffix; |
| 866 } | 865 } |
| 867 | 866 |
| 868 } // namespace chromeos | 867 } // namespace chromeos |
| OLD | NEW |