From 253368a0726120efa57664cdd1d088af099a3d81 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Tue, 25 Nov 2014 15:00:52 -0600 Subject: Reduce libs needed for decrypt and clean up old decypt files Trim cryptfs.c to remove functions that TWRP does not use for decrypt and remove the need for libfs_mgr from cryptfs.c by passing some items to cryptfs.c from the partition manager. Add support for new fstab flags: encryptable and forceencrypt=/path/to/cryptokey For example: flags=forceencrypt=/dev/block/platform/sdhci-tegra.3/by-name/MD1 Note that "footer" is the default, so you do not need to set this flag on devices that use the footer for the crypto key. Also add mounttodecrypt if you need to mount a partition during the decrypt cycle for firmware of proprietary libs. Clean up decrypt and only support one version Android 5.0 lollipop decrypt should be backwards compatible with older versions so we will only support one version, 1.3 that came with 5.0 lollipop. Remove support for Samsung TouchWiz decrypt. It does not work with the latest versions of Samsung encryption anyway and it has not been updated to work with any AOSP decryption higher than 1.1 Change-Id: I2d9c6e31df50268c91ee642c2fa090f901d9d5c9 --- crypto/libcrypt_samsung/libcrypt_samsung.c | 65 ------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 crypto/libcrypt_samsung/libcrypt_samsung.c (limited to 'crypto/libcrypt_samsung/libcrypt_samsung.c') diff --git a/crypto/libcrypt_samsung/libcrypt_samsung.c b/crypto/libcrypt_samsung/libcrypt_samsung.c deleted file mode 100644 index cd3a17804..000000000 --- a/crypto/libcrypt_samsung/libcrypt_samsung.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2013 a3955269 all rights reversed, no rights reserved. - */ - -////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#include "include/libcrypt_samsung.h" - -////////////////////////////////////////////////////////////////////////////// - -int decrypt_EDK( - dek_t *dek, const edk_payload_t *edk, /*const*/ char *passwd) -{ - void *lib = dlopen("libsec_km.so", RTLD_LAZY); - - if(!lib) - return -100; - - int r = -101; - decrypt_EDK_t sym = (decrypt_EDK_t)dlsym(lib, "decrypt_EDK"); - if(sym) - r = sym(dek, edk, passwd); - - dlclose(lib); - - return r; -} - -int mount_ecryptfs_drive( - const char *passwd, const char *source, const char *target, int filter) -{ - void *lib = dlopen("libsec_ecryptfs.so", RTLD_LAZY); - if(!lib) - return -100; - - int r = -101; - mount_ecryptfs_drive_t sym = (mount_ecryptfs_drive_t)dlsym(lib, "mount_ecryptfs_drive"); - if(sym) - r = sym(passwd, source, target, filter); - - dlclose(lib); - - return r; -} - -int unmount_ecryptfs_drive( - const char *source) -{ - void *lib = dlopen("libsec_ecryptfs.so", RTLD_LAZY); - if(!lib) - return -100; - - int r = -101; - unmount_ecryptfs_drive_t sym = (unmount_ecryptfs_drive_t)dlsym(lib, "unmount_ecryptfs_drive"); - if(sym) - r = sym(source); - - dlclose(lib); - - return r; -} \ No newline at end of file -- cgit v1.2.3