From ad84244079894904143f66b81370cab70873191d Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Wed, 31 Jul 2013 05:17:23 +0000 Subject: cros: Use AsyncMountPublic to mount kiosk app home. MountPublic/AsyncMountPublic mounts cryptohome for a given public mount id using an encrypted, root access only public_mount_salt. The CL changes to use that for mounting kiosk app's cryptohome. Since the current the kiosk app could rebuild their data, no migration is done and old cryptohome is simply nuked. Also the CL changes to use kiosk app's account id instead of app id for mounting its cryptohome. BUG=243099 Review URL: https://chromiumcodereview.appspot.com/20813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214571 0039d316-1c4b-4281-b951-d872f2087c98 --- chromeos/cryptohome/async_method_caller.cc | 11 +++++++++++ chromeos/cryptohome/async_method_caller.h | 8 ++++++++ chromeos/cryptohome/mock_async_method_caller.h | 3 +++ 3 files changed, 22 insertions(+) (limited to 'chromeos/cryptohome') diff --git a/chromeos/cryptohome/async_method_caller.cc b/chromeos/cryptohome/async_method_caller.cc index 80c8878..92392d9 100644 --- a/chromeos/cryptohome/async_method_caller.cc +++ b/chromeos/cryptohome/async_method_caller.cc @@ -91,6 +91,17 @@ class AsyncMethodCallerImpl : public AsyncMethodCaller { "Couldn't initiate async mount of cryptohome.")); } + virtual void AsyncMountPublic(const std::string& public_mount_id, + int flags, + Callback callback) OVERRIDE { + DBusThreadManager::Get()->GetCryptohomeClient()-> + AsyncMountPublic(public_mount_id, flags, base::Bind( + &AsyncMethodCallerImpl::RegisterAsyncCallback, + weak_ptr_factory_.GetWeakPtr(), + callback, + "Couldn't initiate async mount public of cryptohome.")); + } + virtual void AsyncRemove(const std::string& user_email, Callback callback) OVERRIDE { DBusThreadManager::Get()->GetCryptohomeClient()-> diff --git a/chromeos/cryptohome/async_method_caller.h b/chromeos/cryptohome/async_method_caller.h index 04f9fb6..7414284 100644 --- a/chromeos/cryptohome/async_method_caller.h +++ b/chromeos/cryptohome/async_method_caller.h @@ -87,6 +87,14 @@ class CHROMEOS_EXPORT AsyncMethodCaller { // |callback| will be called with status info on completion. virtual void AsyncMountGuest(Callback callback) = 0; + // Asks cryptohomed to asynchrounously try to find the cryptohome for + // |public_mount_id| and then mount it using a passhash derived from + // |public_mount_id| and a secret. See AsyncMount for possible values for + // |flags|. + virtual void AsyncMountPublic(const std::string& public_mount_id, + int flags, + Callback callback) = 0; + // Asks cryptohomed to asynchronously try to find the cryptohome for // |user_email| and then nuke it. virtual void AsyncRemove(const std::string& user_email, diff --git a/chromeos/cryptohome/mock_async_method_caller.h b/chromeos/cryptohome/mock_async_method_caller.h index 45be7f8..74567ca 100644 --- a/chromeos/cryptohome/mock_async_method_caller.h +++ b/chromeos/cryptohome/mock_async_method_caller.h @@ -43,6 +43,9 @@ class MockAsyncMethodCaller : public AsyncMethodCaller { const std::string& new_key, Callback callback)); MOCK_METHOD1(AsyncMountGuest, void(Callback callback)); + MOCK_METHOD3(AsyncMountPublic, void(const std::string& public_mount_id, + int flags, + Callback callback)); MOCK_METHOD2(AsyncRemove, void(const std::string& user_email, Callback callback)); MOCK_METHOD1(AsyncTpmAttestationCreateEnrollRequest, -- cgit v1.1