diff options
author | Bill Yi <byi@google.com> | 2015-02-19 14:33:24 -0800 |
---|---|---|
committer | Bill Yi <byi@google.com> | 2015-02-19 14:33:24 -0800 |
commit | 0cc8da09473affeb8a396b92813e5f8ce5500292 (patch) | |
tree | 99f3244ef8af7a53f0c9065eec5a08ac1f464a75 /fs_mgr | |
parent | 18daa159ec5f8455f83dd87dad1a1ed1d2501b3e (diff) | |
parent | 9c1bc6bbc82e3e4f005e9fcacfca94b2dd82ca31 (diff) | |
download | system_core-0cc8da09473affeb8a396b92813e5f8ce5500292.zip system_core-0cc8da09473affeb8a396b92813e5f8ce5500292.tar.gz system_core-0cc8da09473affeb8a396b92813e5f8ce5500292.tar.bz2 |
Merge commit '9c1bc6bbc82e3e4f005e9fcacfca94b2dd82ca31' into HEAD
Diffstat (limited to 'fs_mgr')
-rw-r--r-- | fs_mgr/fs_mgr.c | 7 | ||||
-rw-r--r-- | fs_mgr/fs_mgr_fstab.c | 5 | ||||
-rw-r--r-- | fs_mgr/fs_mgr_verity.c | 6 | ||||
-rw-r--r-- | fs_mgr/include/fs_mgr.h | 1 |
4 files changed, 8 insertions, 11 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c index a1391e0..8b2d439 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -154,9 +154,10 @@ static void check_fs(char *blk_device, char *fs_type, char *target) } else if (!strcmp(fs_type, "f2fs")) { char *f2fs_fsck_argv[] = { F2FS_FSCK_BIN, + "-f", blk_device }; - INFO("Running %s on %s\n", F2FS_FSCK_BIN, blk_device); + INFO("Running %s -f %s\n", F2FS_FSCK_BIN, blk_device); ret = android_fork_execvp_ext(ARRAY_SIZE(f2fs_fsck_argv), f2fs_fsck_argv, &status, true, LOG_KLOG | LOG_FILE, @@ -487,7 +488,9 @@ int fs_mgr_mount_all(struct fstab *fstab) /* Deal with encryptability. */ if (!mret) { /* If this is encryptable, need to trigger encryption */ - if (fs_mgr_is_encryptable(&fstab->recs[attempted_idx])) { + if ( (fstab->recs[attempted_idx].fs_mgr_flags & MF_FORCECRYPT) + || (device_is_force_encrypted() + && 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 9d536bd..ab8f128 100644 --- a/fs_mgr/fs_mgr_fstab.c +++ b/fs_mgr/fs_mgr_fstab.c @@ -428,11 +428,6 @@ 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/fs_mgr_verity.c b/fs_mgr/fs_mgr_verity.c index 4683acb..ece0b5b 100644 --- a/fs_mgr/fs_mgr_verity.c +++ b/fs_mgr/fs_mgr_verity.c @@ -86,11 +86,11 @@ static RSAPublicKey *load_key(char *path) static int verify_table(char *signature, char *table, int table_length) { RSAPublicKey *key; - uint8_t hash_buf[SHA_DIGEST_SIZE]; + uint8_t hash_buf[SHA256_DIGEST_SIZE]; int retval = -1; // Hash the table - SHA_hash((uint8_t*)table, table_length, hash_buf); + SHA256_hash((uint8_t*)table, table_length, hash_buf); // Now get the public key from the keyfile key = load_key(VERITY_TABLE_RSA_KEY); @@ -104,7 +104,7 @@ static int verify_table(char *signature, char *table, int table_length) (uint8_t*) signature, RSANUMBYTES, (uint8_t*) hash_buf, - SHA_DIGEST_SIZE)) { + SHA256_DIGEST_SIZE)) { ERROR("Couldn't verify table."); goto out; } diff --git a/fs_mgr/include/fs_mgr.h b/fs_mgr/include/fs_mgr.h index 5ec3b99..5e2ff41 100644 --- a/fs_mgr/include/fs_mgr.h +++ b/fs_mgr/include/fs_mgr.h @@ -83,7 +83,6 @@ 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 |