Loading fs_mgr/fs_mgr.c +3 −1 Original line number Diff line number Diff line Loading @@ -444,6 +444,7 @@ static int handle_encryptable(struct fstab *fstab, const struct fstab_rec* rec) { /* If this is block encryptable, need to trigger encryption */ if ( (rec->fs_mgr_flags & MF_FORCECRYPT) || (rec->fs_mgr_flags & MF_FORCEFDEORFBE) || (device_is_force_encrypted() && fs_mgr_is_encryptable(rec))) { if (umount(rec->mount_point) == 0) { return FS_MGR_MNTALL_DEV_NEEDS_ENCRYPTION; Loading Loading @@ -881,7 +882,8 @@ int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc, char *real_blk_dev if (fstab->recs[i].fs_mgr_flags & MF_VOLDMANAGED) { continue; } if (!(fstab->recs[i].fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT))) { if (!(fstab->recs[i].fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT | MF_FORCEFDEORFBE))) { continue; } Loading fs_mgr/fs_mgr_fstab.c +12 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ static struct flag_list fs_mgr_flags[] = { { "encryptable=",MF_CRYPT }, { "forceencrypt=",MF_FORCECRYPT }, { "fileencryption",MF_FILEENCRYPTION }, { "forcefdeorfbe=",MF_FORCEFDEORFBE }, { "nonremovable",MF_NONREMOVABLE }, { "voldmanaged=",MF_VOLDMANAGED}, { "length=", MF_LENGTH }, Loading Loading @@ -140,6 +141,11 @@ static int parse_flags(char *flags, struct flag_list *fl, * location of the keys. Get it and return it. */ flag_vals->key_loc = strdup(strchr(p, '=') + 1); } else if ((fl[i].flag == MF_FORCEFDEORFBE) && flag_vals) { /* The forcefdeorfbe flag is followed by an = and the * location of the keys. Get it and return it. */ flag_vals->key_loc = strdup(strchr(p, '=') + 1); } else if ((fl[i].flag == MF_LENGTH) && flag_vals) { /* The length flag is followed by an = and the * size of the partition. Get it and return it. Loading Loading @@ -464,7 +470,7 @@ int fs_mgr_is_verified(const struct fstab_rec *fstab) int fs_mgr_is_encryptable(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT); return fstab->fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT | MF_FORCEFDEORFBE); } int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab) Loading @@ -472,6 +478,11 @@ int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab) return fstab->fs_mgr_flags & MF_FILEENCRYPTION; } int fs_mgr_is_convertible_to_fbe(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_FORCEFDEORFBE; } int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_NOEMULATEDSD; Loading fs_mgr/fs_mgr_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ __BEGIN_DECLS #define MF_FILEENCRYPTION 0x2000 #define MF_FORMATTABLE 0x4000 #define MF_SLOTSELECT 0x8000 #define MF_FORCEFDEORFBE 0x10000 #define DM_BUF_SIZE 4096 Loading fs_mgr/include/fs_mgr.h +1 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ int fs_mgr_is_nonremovable(const struct fstab_rec *fstab); int fs_mgr_is_verified(const struct fstab_rec *fstab); int fs_mgr_is_encryptable(const struct fstab_rec *fstab); int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab); int fs_mgr_is_convertible_to_fbe(const struct fstab_rec *fstab); int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab); int fs_mgr_is_notrim(struct fstab_rec *fstab); int fs_mgr_is_formattable(struct fstab_rec *fstab); Loading Loading
fs_mgr/fs_mgr.c +3 −1 Original line number Diff line number Diff line Loading @@ -444,6 +444,7 @@ static int handle_encryptable(struct fstab *fstab, const struct fstab_rec* rec) { /* If this is block encryptable, need to trigger encryption */ if ( (rec->fs_mgr_flags & MF_FORCECRYPT) || (rec->fs_mgr_flags & MF_FORCEFDEORFBE) || (device_is_force_encrypted() && fs_mgr_is_encryptable(rec))) { if (umount(rec->mount_point) == 0) { return FS_MGR_MNTALL_DEV_NEEDS_ENCRYPTION; Loading Loading @@ -881,7 +882,8 @@ int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc, char *real_blk_dev if (fstab->recs[i].fs_mgr_flags & MF_VOLDMANAGED) { continue; } if (!(fstab->recs[i].fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT))) { if (!(fstab->recs[i].fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT | MF_FORCEFDEORFBE))) { continue; } Loading
fs_mgr/fs_mgr_fstab.c +12 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ static struct flag_list fs_mgr_flags[] = { { "encryptable=",MF_CRYPT }, { "forceencrypt=",MF_FORCECRYPT }, { "fileencryption",MF_FILEENCRYPTION }, { "forcefdeorfbe=",MF_FORCEFDEORFBE }, { "nonremovable",MF_NONREMOVABLE }, { "voldmanaged=",MF_VOLDMANAGED}, { "length=", MF_LENGTH }, Loading Loading @@ -140,6 +141,11 @@ static int parse_flags(char *flags, struct flag_list *fl, * location of the keys. Get it and return it. */ flag_vals->key_loc = strdup(strchr(p, '=') + 1); } else if ((fl[i].flag == MF_FORCEFDEORFBE) && flag_vals) { /* The forcefdeorfbe flag is followed by an = and the * location of the keys. Get it and return it. */ flag_vals->key_loc = strdup(strchr(p, '=') + 1); } else if ((fl[i].flag == MF_LENGTH) && flag_vals) { /* The length flag is followed by an = and the * size of the partition. Get it and return it. Loading Loading @@ -464,7 +470,7 @@ int fs_mgr_is_verified(const struct fstab_rec *fstab) int fs_mgr_is_encryptable(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT); return fstab->fs_mgr_flags & (MF_CRYPT | MF_FORCECRYPT | MF_FORCEFDEORFBE); } int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab) Loading @@ -472,6 +478,11 @@ int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab) return fstab->fs_mgr_flags & MF_FILEENCRYPTION; } int fs_mgr_is_convertible_to_fbe(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_FORCEFDEORFBE; } int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab) { return fstab->fs_mgr_flags & MF_NOEMULATEDSD; Loading
fs_mgr/fs_mgr_priv.h +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ __BEGIN_DECLS #define MF_FILEENCRYPTION 0x2000 #define MF_FORMATTABLE 0x4000 #define MF_SLOTSELECT 0x8000 #define MF_FORCEFDEORFBE 0x10000 #define DM_BUF_SIZE 4096 Loading
fs_mgr/include/fs_mgr.h +1 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ int fs_mgr_is_nonremovable(const struct fstab_rec *fstab); int fs_mgr_is_verified(const struct fstab_rec *fstab); int fs_mgr_is_encryptable(const struct fstab_rec *fstab); int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab); int fs_mgr_is_convertible_to_fbe(const struct fstab_rec *fstab); int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab); int fs_mgr_is_notrim(struct fstab_rec *fstab); int fs_mgr_is_formattable(struct fstab_rec *fstab); Loading