summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/chromeos/policy/device_local_account_browsertest.cc1
-rw-r--r--chromeos/cryptohome/async_method_caller.cc2
-rw-r--r--chromeos/cryptohome/async_method_caller.h1
-rw-r--r--chromeos/cryptohome/mock_async_method_caller.h16
-rw-r--r--chromeos/dbus/cryptohome_client.cc4
-rw-r--r--chromeos/dbus/cryptohome_client.h16
-rw-r--r--chromeos/dbus/mock_cryptohome_client.h3
7 files changed, 31 insertions, 12 deletions
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
index fb160cb..1ecb0bf 100644
--- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -348,6 +348,7 @@ class FakeCryptohomeClient : public chromeos::CryptohomeClient {
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {}
virtual void TpmAttestationSignSimpleChallenge(
diff --git a/chromeos/cryptohome/async_method_caller.cc b/chromeos/cryptohome/async_method_caller.cc
index 6506067..2478182 100644
--- a/chromeos/cryptohome/async_method_caller.cc
+++ b/chromeos/cryptohome/async_method_caller.cc
@@ -158,6 +158,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller {
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ chromeos::CryptohomeClient::AttestationChallengeOptions options,
const std::string& challenge,
const DataCallback& callback) OVERRIDE {
DBusThreadManager::Get()->GetCryptohomeClient()->
@@ -166,6 +167,7 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller {
key_name,
domain,
device_id,
+ options,
challenge,
base::Bind(
&AsyncMethodCallerImpl::RegisterAsyncDataCallback,
diff --git a/chromeos/cryptohome/async_method_caller.h b/chromeos/cryptohome/async_method_caller.h
index ff62748..0957397 100644
--- a/chromeos/cryptohome/async_method_caller.h
+++ b/chromeos/cryptohome/async_method_caller.h
@@ -133,6 +133,7 @@ class CHROMEOS_EXPORT AsyncMethodCaller {
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ chromeos::CryptohomeClient::AttestationChallengeOptions options,
const std::string& challenge,
const DataCallback& callback) = 0;
diff --git a/chromeos/cryptohome/mock_async_method_caller.h b/chromeos/cryptohome/mock_async_method_caller.h
index c4e2ec1..8fc2b8b 100644
--- a/chromeos/cryptohome/mock_async_method_caller.h
+++ b/chromeos/cryptohome/mock_async_method_caller.h
@@ -56,13 +56,15 @@ class MockAsyncMethodCaller : public AsyncMethodCaller {
void(chromeos::CryptohomeClient::AttestationKeyType key_type,
const std::string& key_name,
const Callback& callback));
- MOCK_METHOD6(TpmAttestationSignEnterpriseChallenge,
- void(chromeos::CryptohomeClient::AttestationKeyType key_type,
- const std::string& key_name,
- const std::string& domain,
- const std::string& device_id,
- const std::string& challenge,
- const DataCallback& callback));
+ MOCK_METHOD7(
+ TpmAttestationSignEnterpriseChallenge,
+ void(chromeos::CryptohomeClient::AttestationKeyType key_type,
+ const std::string& key_name,
+ const std::string& domain,
+ const std::string& device_id,
+ chromeos::CryptohomeClient::AttestationChallengeOptions options,
+ const std::string& challenge,
+ const DataCallback& callback));
MOCK_METHOD4(TpmAttestationSignSimpleChallenge,
void(chromeos::CryptohomeClient::AttestationKeyType key_type,
const std::string& key_name,
diff --git a/chromeos/dbus/cryptohome_client.cc b/chromeos/dbus/cryptohome_client.cc
index b5369f6..27e8af0 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -519,6 +519,7 @@ class CryptohomeClientImpl : public CryptohomeClient {
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
dbus::MethodCall method_call(
@@ -530,6 +531,8 @@ class CryptohomeClientImpl : public CryptohomeClient {
writer.AppendString(key_name);
writer.AppendString(domain);
writer.AppendString(device_id);
+ bool include_signed_public_key = (options & INCLUDE_SIGNED_PUBLIC_KEY);
+ writer.AppendBool(include_signed_public_key);
writer.AppendString(challenge);
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&CryptohomeClientImpl::OnAsyncMethodCall,
@@ -1052,6 +1055,7 @@ class CryptohomeClientStubImpl : public CryptohomeClient {
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) OVERRIDE {
ReturnAsyncMethodResult(callback, true);
diff --git a/chromeos/dbus/cryptohome_client.h b/chromeos/dbus/cryptohome_client.h
index 88c4dbc..7cc3c23 100644
--- a/chromeos/dbus/cryptohome_client.h
+++ b/chromeos/dbus/cryptohome_client.h
@@ -60,6 +60,12 @@ class CHROMEOS_EXPORT CryptohomeClient {
USER_KEY
};
+ // Options available for customizing an attestation challenge response.
+ enum AttestationChallengeOptions {
+ CHALLENGE_RESPONSE_OPTION_NONE = 0,
+ INCLUDE_SIGNED_PUBLIC_KEY = 1
+ };
+
virtual ~CryptohomeClient();
// Factory function, creates a new instance and returns ownership.
@@ -292,15 +298,17 @@ class CHROMEOS_EXPORT CryptohomeClient {
// Asynchronously signs an enterprise challenge with the key specified by
// |key_type| and |key_name|. |domain| and |device_id| will be included in
- // the challenge response. |challenge| must be a valid enterprise attestation
- // challenge. The |callback| will be called when the dbus call completes.
- // When the operation completes, the AsyncCallStatusWithDataHandler signal
- // handler is called.
+ // the challenge response. |options| control how the challenge response is
+ // generated. |challenge| must be a valid enterprise attestation challenge.
+ // The |callback| will be called when the dbus call completes. When the
+ // operation completes, the AsyncCallStatusWithDataHandler signal handler is
+ // called.
virtual void TpmAttestationSignEnterpriseChallenge(
AttestationKeyType key_type,
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback) = 0;
diff --git a/chromeos/dbus/mock_cryptohome_client.h b/chromeos/dbus/mock_cryptohome_client.h
index df8b849..5a68370 100644
--- a/chromeos/dbus/mock_cryptohome_client.h
+++ b/chromeos/dbus/mock_cryptohome_client.h
@@ -107,11 +107,12 @@ class MockCryptohomeClient : public CryptohomeClient {
void(AttestationKeyType key_type,
const std::string& key_name,
const AsyncMethodCallback& callback));
- MOCK_METHOD6(TpmAttestationSignEnterpriseChallenge,
+ MOCK_METHOD7(TpmAttestationSignEnterpriseChallenge,
void(AttestationKeyType key_type,
const std::string& key_name,
const std::string& domain,
const std::string& device_id,
+ AttestationChallengeOptions options,
const std::string& challenge,
const AsyncMethodCallback& callback));
MOCK_METHOD4(TpmAttestationSignSimpleChallenge,