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

Unified Diff: chromeos/dbus/cryptohome_client.cc

Issue 14305009: Enhanced and refactored the AttestationFlow interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/cryptohome_client.cc
diff --git a/chromeos/dbus/cryptohome_client.cc b/chromeos/dbus/cryptohome_client.cc
index 7bcbc4a338322360ecf7c93e424f25c5c2684537..35aee51368723c39206f30fce11191135cec16d8 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -412,9 +412,9 @@ class CryptohomeClientImpl : public CryptohomeClient {
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeAsyncTpmAttestationCreateCertRequest);
dbus::MessageWriter writer(&method_call);
- bool include_stable_id = (options & INCLUDE_STABLE_ID);
+ bool include_stable_id = (options & attestation::INCLUDE_STABLE_ID);
writer.AppendBool(include_stable_id);
- bool include_device_state = (options & INCLUDE_DEVICE_STATE);
+ bool include_device_state = (options & attestation::INCLUDE_DEVICE_STATE);
writer.AppendBool(include_device_state);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall,
@@ -425,7 +425,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void AsyncTpmAttestationFinishCertRequest(
const std::string& pca_response,
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const AsyncMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
@@ -435,7 +435,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
writer.AppendArrayOfBytes(
reinterpret_cast<const uint8*>(pca_response.data()),
pca_response.size());
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
@@ -446,14 +446,14 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationDoesKeyExist(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const BoolDBusMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationDoesKeyExist);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
CallBoolMethod(&method_call, callback);
@@ -461,14 +461,14 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationGetCertificate(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationGetCertificate);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
@@ -479,14 +479,14 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationGetPublicKey(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationGetPublicKey);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
@@ -497,14 +497,14 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationRegisterKey(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const AsyncMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationRegisterKey);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
@@ -515,24 +515,25 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationSignEnterpriseChallenge(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
- AttestationChallengeOptions options,
+ attestation::AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationSignEnterpriseChallenge);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
writer.AppendString(domain);
writer.AppendArrayOfBytes(reinterpret_cast<const uint8*>(device_id.data()),
device_id.size());
- bool include_signed_public_key = (options & INCLUDE_SIGNED_PUBLIC_KEY);
+ bool include_signed_public_key =
+ (options & attestation::INCLUDE_SIGNED_PUBLIC_KEY);
writer.AppendBool(include_signed_public_key);
writer.AppendArrayOfBytes(reinterpret_cast<const uint8*>(challenge.data()),
challenge.size());
@@ -544,7 +545,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationSignSimpleChallenge(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
@@ -552,7 +553,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationSignEnterpriseChallenge);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
writer.AppendArrayOfBytes(reinterpret_cast<const uint8*>(challenge.data()),
@@ -565,14 +566,14 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationGetKeyPayload(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationGetKeyPayload);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
@@ -583,7 +584,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationSetKeyPayload(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& payload,
const BoolDBusMethodCallback& callback) OVERRIDE {
@@ -591,7 +592,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
cryptohome::kCryptohomeInterface,
cryptohome::kCryptohomeTpmAttestationSetKeyPayload);
dbus::MessageWriter writer(&method_call);
- bool is_user_specific = (key_type == USER_KEY);
+ bool is_user_specific = (key_type == attestation::USER_KEY);
writer.AppendBool(is_user_specific);
writer.AppendString(key_name);
writer.AppendArrayOfBytes(reinterpret_cast<const uint8*>(payload.data()),
@@ -1043,7 +1044,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void AsyncTpmAttestationFinishCertRequest(
const std::string& pca_response,
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const AsyncMethodCallback& callback) OVERRIDE {
ReturnAsyncMethodResult(callback, true);
@@ -1051,7 +1052,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationDoesKeyExist(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const BoolDBusMethodCallback& callback) OVERRIDE {
MessageLoop::current()->PostTask(
@@ -1061,7 +1062,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationGetCertificate(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
MessageLoop::current()->PostTask(
@@ -1071,7 +1072,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationGetPublicKey(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
MessageLoop::current()->PostTask(
@@ -1081,7 +1082,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationRegisterKey(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const AsyncMethodCallback& callback) OVERRIDE {
ReturnAsyncMethodResult(callback, true);
@@ -1089,11 +1090,11 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationSignEnterpriseChallenge(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
- AttestationChallengeOptions options,
+ attestation::AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
ReturnAsyncMethodResult(callback, true);
@@ -1101,7 +1102,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
// CryptohomeClient override.
virtual void TpmAttestationSignSimpleChallenge(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
@@ -1109,7 +1110,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
}
virtual void TpmAttestationGetKeyPayload(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const DataMethodCallback& callback) OVERRIDE {
MessageLoop::current()->PostTask(
@@ -1118,7 +1119,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
}
virtual void TpmAttestationSetKeyPayload(
- AttestationKeyType key_type,
+ attestation::AttestationKeyType key_type,
const std::string& key_name,
const std::string& payload,
const BoolDBusMethodCallback& callback) OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698