Skip to content

Commit fcc3deb

Browse files
AnilKumar Chimatabigbiff
AnilKumar Chimata
authored andcommitted
vold: Add Hardware FDE feature
Add HW FDE changes to new tip along with soong rules for conditional compilation. Following changes for HW FDE as well ported: - Restart Android framework after HW FDE key has been created - Add support of Inline Cryto Engine - Use new HW FDE apis to update password - vold: Tie HW FDE keys with Root of Trust(ROT) - vold: Fix HW FDE OTA support on SW FDE encrypted device - vold: Fix return value from get_keymaster_hw_fde_passwd() - vold: Remove creation of new keymaster key for password update - vold: Fix password update issue with HW FDE - vold: hw_fde: fix OTA issues from L to M - vold: Branch out SW and HW FDE paths to improve boot up time - cryptfs: Use lower case alphabets for hex key during OTA upgrades - vold: Improve device boot up time (Tune sleep calls) - Retry mount if mount fails after setting HW FDE key - cryptfs: Fix compilation error - cryptfs: Fix mount failure when encryption triggered from settings - cryptfs: fix issue that caused problems with forced HW encryption - cryptfs: fix wrong password set by user during bootup. CRs-Fixed: 2210986 Change-Id: I77279fc7e309ac94535123a2b2dbcb228bb47251
1 parent 36bda35 commit fcc3deb

File tree

6 files changed

+535
-16
lines changed

6 files changed

+535
-16
lines changed

Android.bp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ cc_library_static {
162162
debuggable: {
163163
cppflags: ["-D__ANDROID_DEBUGGABLE__"],
164164
},
165+
device_support_hwfde: {
166+
cflags: ["-DCONFIG_HW_DISK_ENCRYPTION"],
167+
header_libs: ["libcryptfs_hw_headers"],
168+
shared_libs: ["libcryptfs_hw"],
169+
},
165170
},
166171
shared_libs: [
167172
@@ -215,6 +220,9 @@ cc_binary {
215220
"libarcvolume",
216221
],
217222
},
223+
device_support_hwfde: {
224+
shared_libs: ["libcryptfs_hw"],
225+
}
218226
},
219227
}
220228

VoldNativeService.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,12 @@ binder::Status VoldNativeService::fdeEnable(int32_t passwordType, const std::str
590590
}
591591

592592
binder::Status VoldNativeService::fdeChangePassword(int32_t passwordType,
593+
const std::string& currentPassword,
593594
const std::string& password) {
594595
ENFORCE_SYSTEM_OR_ROOT;
595596
ACQUIRE_CRYPT_LOCK;
596597

597-
return translate(cryptfs_changepw(passwordType, password.c_str()));
598+
return translate(cryptfs_changepw(passwordType, currentPassword.c_str(), password.c_str()));
598599
}
599600

600601
binder::Status VoldNativeService::fdeVerifyPassword(const std::string& password) {

VoldNativeService.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ class VoldNativeService : public BinderService<VoldNativeService>, public os::Bn
9999
binder::Status fdeComplete(int32_t* _aidl_return);
100100
binder::Status fdeEnable(int32_t passwordType, const std::string& password,
101101
int32_t encryptionFlags);
102-
binder::Status fdeChangePassword(int32_t passwordType, const std::string& password);
102+
binder::Status fdeChangePassword(int32_t passwordType,
103+
const std::string& currentPassword,
104+
const std::string& password);
103105
binder::Status fdeVerifyPassword(const std::string& password);
104106
binder::Status fdeGetField(const std::string& key, std::string* _aidl_return);
105107
binder::Status fdeSetField(const std::string& key, const std::string& value);

binder/android/os/IVold.aidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ interface IVold {
7575
void fdeRestart();
7676
int fdeComplete();
7777
void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
78-
void fdeChangePassword(int passwordType, @utf8InCpp String password);
78+
void fdeChangePassword(int passwordType, @utf8InCpp String currentPassword, @utf8InCpp String password);
7979
void fdeVerifyPassword(@utf8InCpp String password);
8080
@utf8InCpp String fdeGetField(@utf8InCpp String key);
8181
void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);

0 commit comments

Comments
 (0)