Skip to content

Commit

Permalink
Change to dd for wiping crypto partitions
Browse files Browse the repository at this point in the history
flash_image was spitting an error. We are also specifying a size
so that we do not risk writing beyond the partition.

Change-Id: Ie3a0d77db96e54357238595934c3df0e3b680823
  • Loading branch information
Dees-Troy committed Mar 17, 2016
1 parent 4745e89 commit c2dafbb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c2dafbb

Please sign in to comment.