summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-03-16 04:20:59 +0100
committerDees Troy <dees_troy@teamw.in>2016-03-17 21:55:41 +0100
commitc2dafbbba6630e5d0416466209688c242e4c280c (patch)
tree5d9df7e0d57e5120a5bd3c3b6ee6de6c4ac58b41
parentFinally update NOTICE file to contain GPL v3 (diff)
downloadandroid_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar.gz
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar.bz2
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar.lz
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar.xz
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.tar.zst
android_bootable_recovery-c2dafbbba6630e5d0416466209688c242e4c280c.zip
-rw-r--r--partition.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/partition.cpp b/partition.cpp
index 354563466..979272a44 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -1611,8 +1611,12 @@ bool TWPartition::Wipe_Encryption() {
close(fd);
}
} else {
- string Command = "flash_image " + Crypto_Key_Location + " /dev/zero";
- TWFunc::Exec_Cmd(Command);
+ if (TWFunc::IOCTL_Get_Block_Size(Crypto_Key_Location.c_str()) >= 16384LLU) {
+ string Command = "dd of='" + Crypto_Key_Location + "' if=/dev/zero bs=16384 count=1";
+ TWFunc::Exec_Cmd(Command);
+ } else {
+ LOGINFO("Crypto key location reports size < 16K so not wiping crypto footer.\n");
+ }
}
if (Wipe(Fstab_File_System)) {
Has_Data_Media = Save_Data_Media;