diff options
author | Brahmaji K <bkomma@codeaurora.org> | 2017-02-20 20:16:28 +0530 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2017-12-20 23:31:26 +0200 |
commit | 5bbd79ba912159df838b27f8608f9b44ab040f17 (patch) | |
tree | 7f41571af11fee8a66bd4c4a5a9230f2775226a1 | |
parent | 6e3227e42a45e26fc97ad46fd65541cab63032e8 (diff) | |
download | android_vendor_qcom_opensource_cryptfs_hw-5bbd79ba912159df838b27f8608f9b44ab040f17.tar.gz android_vendor_qcom_opensource_cryptfs_hw-5bbd79ba912159df838b27f8608f9b44ab040f17.tar.bz2 android_vendor_qcom_opensource_cryptfs_hw-5bbd79ba912159df838b27f8608f9b44ab040f17.zip |
cryptfs_hw: Remove android reboot during password check
After reaching the maximum number of retires with wrong password,
userdata is erased based on the info written on /cache partition.
As per the latest changes of A/B, cache partition is not present
which leads to failure of userdata wipe before reboot. This patch
removes reboot from cryptfs_hw layer if max entries reached, as
frameworks take care of userdata wipe.
Change-Id: If97f2f7452beb004f44d7d41d1d76def23fe2720
-rwxr-xr-x | cryptfs_hw.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/cryptfs_hw.c b/cryptfs_hw.c index c7b1b30..0006966 100755 --- a/cryptfs_hw.c +++ b/cryptfs_hw.c @@ -117,19 +117,6 @@ static unsigned char* get_tmp_passwd(const char* passwd) return tmp_passwd; } -static void wipe_userdata() -{ - mkdir("/cache/recovery", 0700); - int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC|O_NOFOLLOW, 0600); - if (fd >= 0) { - write(fd, "--wipe_data", strlen("--wipe_data") + 1); - close(fd); - } else { - SLOGE("could not open /cache/recovery/command\n"); - } - android_reboot(ANDROID_RB_RESTART2, 0, "recovery"); -} - static int is_qseecom_up() { int i = 0; @@ -208,7 +195,7 @@ static int set_key(const char* currentpasswd, const char* passwd, const char* en } if(err < 0) { if(ERR_MAX_PASSWORD_ATTEMPTS == err) - wipe_userdata(); + SLOGI("Maximum wrong password attempts reached, will erase userdata\n"); } secure_memset(tmp_passwd, 0, MAX_PASSWORD_LEN); free(tmp_passwd); |