summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2015-01-21 09:57:01 -0800
committerPaul Lawrence <paullawrence@google.com>2015-01-21 10:03:29 -0800
commitbda6272446454886339841a62daaa1b66c07ad60 (patch)
tree62853a7f9d46dea01fb29d50da39fe7f4608579c /fs_mgr
parent70f6dea9d06876bc65181c40ee9e623be196fb4c (diff)
downloadsystem_core-bda6272446454886339841a62daaa1b66c07ad60.zip
system_core-bda6272446454886339841a62daaa1b66c07ad60.tar.gz
system_core-bda6272446454886339841a62daaa1b66c07ad60.tar.bz2
Make encryption configurable
Delay mounting encryptable but unencrypted volumes until we can check the ro.vold.forceencrypt flag, then optionally encrypt. Requires matching vold change from https://googleplex-android-review.git.corp.google.com/#/c/615309/ Bug: 18764230 Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr.c4
-rw-r--r--fs_mgr/fs_mgr_fstab.c5
-rw-r--r--fs_mgr/include/fs_mgr.h1
3 files changed, 7 insertions, 3 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index ad02922..3eb2872 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -387,9 +387,7 @@ int fs_mgr_mount_all(struct fstab *fstab)
/* Deal with encryptability. */
if (!mret) {
/* If this is encryptable, need to trigger encryption */
- if ( (fstab->recs[attempted_idx].fs_mgr_flags & MF_FORCECRYPT)
- || (device_is_force_encrypted()
- && fs_mgr_is_encryptable(&fstab->recs[attempted_idx]))) {
+ if (fs_mgr_is_encryptable(&fstab->recs[attempted_idx])) {
if (umount(fstab->recs[attempted_idx].mount_point) == 0) {
if (encryptable == FS_MGR_MNTALL_DEV_NOT_ENCRYPTED) {
ERROR("Will try to encrypt %s %s\n", fstab->recs[attempted_idx].mount_point,
diff --git a/fs_mgr/fs_mgr_fstab.c b/fs_mgr/fs_mgr_fstab.c
index ab8f128..9d536bd 100644
--- a/fs_mgr/fs_mgr_fstab.c
+++ b/fs_mgr/fs_mgr_fstab.c
@@ -428,6 +428,11 @@ int fs_mgr_is_encryptable(struct fstab_rec *fstab)
return fstab->fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT);
}
+int fs_mgr_is_force_encrypted(struct fstab_rec *fstab)
+{
+ return fstab->fs_mgr_flags & MF_FORCECRYPT;
+}
+
int fs_mgr_is_noemulatedsd(struct fstab_rec *fstab)
{
return fstab->fs_mgr_flags & MF_NOEMULATEDSD;
diff --git a/fs_mgr/include/fs_mgr.h b/fs_mgr/include/fs_mgr.h
index 5e2ff41..5ec3b99 100644
--- a/fs_mgr/include/fs_mgr.h
+++ b/fs_mgr/include/fs_mgr.h
@@ -83,6 +83,7 @@ int fs_mgr_is_voldmanaged(struct fstab_rec *fstab);
int fs_mgr_is_nonremovable(struct fstab_rec *fstab);
int fs_mgr_is_verified(struct fstab_rec *fstab);
int fs_mgr_is_encryptable(struct fstab_rec *fstab);
+int fs_mgr_is_force_encrypted(struct fstab_rec *fstab);
int fs_mgr_is_noemulatedsd(struct fstab_rec *fstab);
int fs_mgr_swapon_all(struct fstab *fstab);
#ifdef __cplusplus