summaryrefslogtreecommitdiffstats
path: root/chromeos/cryptohome
diff options
context:
space:
mode:
authordkrahn@google.com <dkrahn@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 22:15:59 +0000
committerdkrahn@google.com <dkrahn@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 22:15:59 +0000
commit64494c3febd59f7c78f672e35ab60b705ce66017 (patch)
tree844fea96e9b9af21c5b176f157ba0e50044ff87c /chromeos/cryptohome
parent93f90980f27779675775113bc681021d020dd142 (diff)
downloadchromium_src-64494c3febd59f7c78f672e35ab60b705ce66017.zip
chromium_src-64494c3febd59f7c78f672e35ab60b705ce66017.tar.gz
chromium_src-64494c3febd59f7c78f672e35ab60b705ce66017.tar.bz2
Added support for the content protection profile to AttestationFlow.
This change moves all attestation certificate requests to the new CreateCertRequestByProfile dbus method. BUG=chromium:260504 TEST=unit, manual Review URL: https://chromiumcodereview.appspot.com/20873002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/cryptohome')
-rw-r--r--chromeos/cryptohome/async_method_caller.cc8
-rw-r--r--chromeos/cryptohome/async_method_caller.h13
-rw-r--r--chromeos/cryptohome/mock_async_method_caller.cc4
-rw-r--r--chromeos/cryptohome/mock_async_method_caller.h9
4 files changed, 23 insertions, 11 deletions
diff --git a/chromeos/cryptohome/async_method_caller.cc b/chromeos/cryptohome/async_method_caller.cc
index 92392d9..c9af98a 100644
--- a/chromeos/cryptohome/async_method_caller.cc
+++ b/chromeos/cryptohome/async_method_caller.cc
@@ -133,11 +133,15 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller {
}
virtual void AsyncTpmAttestationCreateCertRequest(
- int options,
+ chromeos::attestation::AttestationCertificateProfile certificate_profile,
+ const std::string& username,
+ const std::string& request_origin,
const DataCallback& callback) OVERRIDE {
DBusThreadManager::Get()->GetCryptohomeClient()->
AsyncTpmAttestationCreateCertRequest(
- options,
+ certificate_profile,
+ username,
+ request_origin,
base::Bind(&AsyncMethodCallerImpl::RegisterAsyncDataCallback,
weak_ptr_factory_.GetWeakPtr(),
callback,
diff --git a/chromeos/cryptohome/async_method_caller.h b/chromeos/cryptohome/async_method_caller.h
index 7414284..e5ca604 100644
--- a/chromeos/cryptohome/async_method_caller.h
+++ b/chromeos/cryptohome/async_method_caller.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "chromeos/attestation/attestation_constants.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -113,11 +114,15 @@ class CHROMEOS_EXPORT AsyncMethodCaller {
const Callback& callback) = 0;
// Asks cryptohomed to asynchronously create an attestation certificate
- // request according to |options|, which is a combination of
- // attestation::AttestationCertificateOptions. On success the data sent to
- // |callback| is a request to be sent to the Privacy CA.
+ // request according to |certificate_profile|. Some profiles require that the
+ // |user_email| of the currently active user and an identifier of the
+ // |request_origin| be provided. On success the data sent to |callback| is a
+ // request to be sent to the Privacy CA. The |request_origin| may be sent to
+ // the Privacy CA but the |user_email| will never be sent.
virtual void AsyncTpmAttestationCreateCertRequest(
- int options,
+ chromeos::attestation::AttestationCertificateProfile certificate_profile,
+ const std::string& user_email,
+ const std::string& request_origin,
const DataCallback& callback) = 0;
// Asks cryptohomed to asynchronously finish an attestation certificate
diff --git a/chromeos/cryptohome/mock_async_method_caller.cc b/chromeos/cryptohome/mock_async_method_caller.cc
index 9bd8193..dcd59a0 100644
--- a/chromeos/cryptohome/mock_async_method_caller.cc
+++ b/chromeos/cryptohome/mock_async_method_caller.cc
@@ -51,9 +51,9 @@ void MockAsyncMethodCaller::SetUp(bool success, MountError return_code) {
ON_CALL(*this, AsyncTpmAttestationEnroll(_, _))
.WillByDefault(
WithArgs<1>(Invoke(this, &MockAsyncMethodCaller::DoCallback)));
- ON_CALL(*this, AsyncTpmAttestationCreateCertRequest(_, _))
+ ON_CALL(*this, AsyncTpmAttestationCreateCertRequest(_, _, _, _))
.WillByDefault(
- WithArgs<1>(Invoke(this,
+ WithArgs<3>(Invoke(this,
&MockAsyncMethodCaller::FakeCreateCertRequest)));
ON_CALL(*this, AsyncTpmAttestationFinishCertRequest(_, _, _, _))
.WillByDefault(
diff --git a/chromeos/cryptohome/mock_async_method_caller.h b/chromeos/cryptohome/mock_async_method_caller.h
index 74567ca..8f3796b 100644
--- a/chromeos/cryptohome/mock_async_method_caller.h
+++ b/chromeos/cryptohome/mock_async_method_caller.h
@@ -52,9 +52,12 @@ class MockAsyncMethodCaller : public AsyncMethodCaller {
void(const DataCallback& callback));
MOCK_METHOD2(AsyncTpmAttestationEnroll,
void(const std::string& pca_response, const Callback& callback));
- MOCK_METHOD2(AsyncTpmAttestationCreateCertRequest,
- void(int options,
- const DataCallback& callback));
+ MOCK_METHOD4(
+ AsyncTpmAttestationCreateCertRequest,
+ void(chromeos::attestation::AttestationCertificateProfile profile,
+ const std::string& user_email,
+ const std::string& request_origin,
+ const DataCallback& callback));
MOCK_METHOD4(AsyncTpmAttestationFinishCertRequest,
void(const std::string& pca_response,
chromeos::attestation::AttestationKeyType key_type,