summaryrefslogtreecommitdiffstats
path: root/chromeos/cryptohome
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 05:17:23 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 05:17:23 +0000
commitad84244079894904143f66b81370cab70873191d (patch)
treeabe227fd28eed75f68fd9f7747573fa6e862991f /chromeos/cryptohome
parent25c6f51153579b0e8c45c0a94670866d1da09be0 (diff)
downloadchromium_src-ad84244079894904143f66b81370cab70873191d.zip
chromium_src-ad84244079894904143f66b81370cab70873191d.tar.gz
chromium_src-ad84244079894904143f66b81370cab70873191d.tar.bz2
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
Diffstat (limited to 'chromeos/cryptohome')
-rw-r--r--chromeos/cryptohome/async_method_caller.cc11
-rw-r--r--chromeos/cryptohome/async_method_caller.h8
-rw-r--r--chromeos/cryptohome/mock_async_method_caller.h3
3 files changed, 22 insertions, 0 deletions
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,