summaryrefslogtreecommitdiffstats
path: root/crypto/fde/main.cpp
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2019-03-20 21:40:44 +0100
committerGerrit Code Review <gerrit2@gerrit.omnirom.org>2019-03-20 21:40:44 +0100
commit908442dfb5ede6580c79d9c14a8c44b0f30670ac (patch)
treefb6556174678001a93cbb355dc5f2a4789932599 /crypto/fde/main.cpp
parentMTP FFS updates: (diff)
parentUpdate FDE decrypt to pie from CAF (diff)
downloadandroid_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar.gz
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar.bz2
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar.lz
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar.xz
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.tar.zst
android_bootable_recovery-908442dfb5ede6580c79d9c14a8c44b0f30670ac.zip
Diffstat (limited to 'crypto/fde/main.cpp')
-rw-r--r--crypto/fde/main.cpp47
1 files changed, 47 insertions, 0 deletions
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 <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <linux/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <linux/dm-ioctl.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <sys/param.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <openssl/evp.h>
+#include <errno.h>
+#include <linux/kdev_t.h>
+#include <time.h>
+#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;
+}