From 98661c1a298cb01c93ae31973a42d152077beae6 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 17 Oct 2018 08:39:28 -0500 Subject: Update FDE decrypt to pie from CAF cryptfs.cpp based on CAF tag LA.UM.7.3.r1-05900-sdm845.0 Used CAF because AOSP no longer contains code for qcom's hardware crypto. Change-Id: I921cbe9bed70989f91449e23b5ac3ec1037b7b97 --- crypto/fde/main.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 crypto/fde/main.cpp (limited to 'crypto/fde/main.cpp') diff --git a/crypto/fde/main.cpp b/crypto/fde/main.cpp new file mode 100644 index 000000000..7051a6d7b --- /dev/null +++ b/crypto/fde/main.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cryptfs.h" +#include "cutils/properties.h" +#include "crypto_scrypt.h" + +void usage() { + printf(" Usage:\n"); + printf(" twrpdec /path/to/userdata /path/to/metadata filesystem password\n"); + printf("\n"); + printf(" The metadata path is the path to the footer. If no metadata\n"); + printf(" partition is present then use footer for this argument.\n"); + printf("\n"); + printf(" Example:\n"); + printf(" twrpdec /dev/block/bootdevice/by-name/userdata footer ext4 0000\n"); +} + +int main(int argc, char **argv) { + if (argc != 5) { + usage(); + return -1; + } + set_partition_data(argv[1], argv[2], argv[3]); + //int ret = cryptfs_check_passwd("30303030"); + int ret = cryptfs_check_passwd(argv[4]); + return 0; +} -- cgit v1.2.3